Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def Disabled(self):
'''Called when the robot is disabled'''
while self.IsDisabled():
wpilib.Wait(0.01)
def Autonomous(self):
'''Called when autonomous mode is enabled'''
self.GetWatchdog().SetEnabled(False)
while self.IsAutonomous() and self.IsEnabled():
wpilib.Wait(0.01)
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)