![]() |
Bit of coding help
So, for autonamous we are using a modified line tracker code, with certain cases for different scenarios. After this loop we want the robot to go backwards, but we can't seem to make it happen.
Code:
case 7: //ALL SENSORS ON *OR* MAYBE AT CROSS |
Re: Bit of coding help
If you want the robot to move backwards, instead of using a while loop, replace with something like...
Code:
drive.arcadeDrive(-.5 , 0); |
Re: Bit of coding help
For some reason this isn't working either. did you mean like this?
Code:
case 7: //ALL SENSORS ON *OR* MAYBE AT CROSS |
Re: Bit of coding help
Quote:
Okay so I can see one clear problem here I think. Timer.delay is generally in milliseconds so you have it going backwardsfor 1 millisecond then stopping. Try increasing Timer.delay to a greater value, say 500, then try it again. Remeber if it goes berserk and doesnt stop for some reason you have a stop button. :) |
Re: Bit of coding help
Quote:
Code:
Timer.delay(1000); |
Re: Bit of coding help
Quote:
Quote:
Code:
Timer.delay(1.0); // only accepts doubles as an argumentHowever, when using other functions in the Timer class, like get(), it will return in microseconds. For our minibot deployment, we start a timer and have a condition timer.get()/1000000 > 110, if true it will deploy. If false, it'll let the user know you can't deploy yet. :) |
| All times are GMT -5. The time now is 11:37. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi