View Single Post
  #17   Spotlight this post!  
Unread 24-02-2014, 04:47
pblankenbaker pblankenbaker is offline
Registered User
FRC #0868
 
Join Date: Feb 2012
Location: Carmel, IN, USA
Posts: 102
pblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of light
Re: Joystick 2/Program issue

Just a heads up, in the autonomous example, I had an error in the code that was suppose to drive for three seconds. The original code would start driving, wait for 3 seconds, but fail to stop driving afterwards. This would have resulted in your robot to continue driving for the next 1.5 seconds as it raised its launcher (until stopAll() was reached).

I've corrected the example in the previous post. Here is the fragment of code that was corrected with the addition of myDrive.stopMotor() (it will stop driving before raising the launcher):

Code:
        // Example of driving at half power for 3 seconds (not sure if this
        // will be forward or backwards on your robot)
        myDrive.drive(-.5, 0.0);
        Timer.delay(3.0);
        // Stop drive motors
        myDrive.stopMotor();
Reply With Quote