|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#5
|
|||
|
|||
|
Re: No Robot Code
Here's a copy of my robot.py sorry but I can't get the NetConsole output until tomorrow.
[code] import wpilib lstick = wpilib.Joystick(1) ljag = wpilib.CANJaguar(3) rstick = wpilib.Joystick(2) rjag = wpilib.CANJaguar(4) def disabled(): pass def autonomous(): pass def teleop(): dog = wpilib.GetWatchdog() dog.SetEnabled(True) dog.SetExpiration(0.25) while wpilib.IsOperatorControl() and wpilib.IsEnabled(): dog.Feed() checkRestart() def run(): """Main loop""" while 1: if wpilib.IsDisabled(): print("Running disabled()") disabled() while wpilib.IsDisabled(): wpilib.Wait(0.01) elif wpilib.IsAutonomous(): print("Running autonomous()") autonomous() while wpilib.IsAutonomous() and wpilib.IsEnabled(): wpilib.Wait(0.01) else: print("Running teleop()") teleop() while wpilib.IsOperatorControl() and wpilib.IsEnabled(): wpilib.Wait(0.01) [\code] |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|