View Single Post
  #3   Spotlight this post!  
Unread 04-12-2015, 10:26
SamCarlberg's Avatar
SamCarlberg SamCarlberg is offline
GRIP, WPILib. 2084 alum
AKA: Sam Carlberg
no team
Team Role: Mentor
 
Join Date: Nov 2015
Rookie Year: 2009
Location: MA
Posts: 54
SamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to behold
Re: Spike Code Problems

operatorControl is only called once, at the start of teleop. So you have to have all of your teleop code in the loop.

This is how your teleop method flows right now:

1. Check if teleop is enabled and the robot is enabled
2. If so, update drivebase inputs
3. Repeat 1 and 2
4. Loop exits -- teleop is over or the robot is disabled
5. Check if the left trigger is pulled and the robot is enabled
6. If so, set the relay
7. Delay 0.1 seconds
8. Exit operatorControl

Move everything after the loop into the loop, then it should work.

Also, you should format your code (alt+shift+F in Netbeans). The indenting is messed up and that can lead to some headache trying to understand the code
__________________
WPILib
GRIP, RobotBuilder
Reply With Quote