How to use the pyfrc.wpilib.Wait function in pyfrc

To help you get started, we’ve selected a few pyfrc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github robotpy / pyfrc / samples / simple / src / robot.py View on Github external
def Disabled(self):
        '''Called when the robot is disabled'''
        while self.IsDisabled():
            wpilib.Wait(0.01)
github robotpy / pyfrc / samples / simple / src / robot.py View on Github external
def Autonomous(self):
        '''Called when autonomous mode is enabled'''
        
        self.GetWatchdog().SetEnabled(False)
        while self.IsAutonomous() and self.IsEnabled():
            wpilib.Wait(0.01)
github robotpy / pyfrc / samples / simple / src / robot.py View on Github external
dog.SetEnabled(True)
        dog.SetExpiration(0.25)

        timer = wpilib.Timer()
        timer.Start()

        while self.IsOperatorControl() and self.IsEnabled():
            dog.Feed()

            # Move a motor with a Joystick
            self.motor.Set(self.lstick.GetY())

            if timer.HasPeriodPassed(1.0):
                print("Analog 8: %s" % self.ds.battery.GetVoltage())

            wpilib.Wait(0.04)