def operatorControl(self):
        '''Called when operation control mode is enabled'''
        
        timer = wpilib.Timer()
        timer.start()

        while self.isOperatorControl() and self.isEnabled():
            
            self.robot_drive.arcadeDrive(self.lstick)

            # Move a motor with a Joystick
            y = self.rstick.getY()
            
            # stop movement backwards when 1 is on
            if self.limit1.get():
                y = max(0, y)
                
            # stop movement forwards when 2 is on
            if self.limit2.get():
                y = min(0, y)
                
            self.motor.set(y)

            wpilib.Timer.delay(0.04)
dataset/ETHPy150Open robotpy/pyfrc/samples/physics/src/robot.py/MyRobot.operatorControl/original