Go to Post Changing lives as a key volunteer is not a right reserved for the "elite" among us anymore. - HurdFIRST [more]
Home
Go Back   Chief Delphi > Technical > Programming > Python
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Spotlight this post!  
Unread 09-05-2011, 17:59
Nickle Nickle is offline
Registered User
FRC #0348
 
Join Date: Dec 2010
Location: Norwell, Mass.
Posts: 6
Nickle is an unknown quantity at this point
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]
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 06:26.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi