![]() |
How to program autonomous
Hello
What is a good and efficient way to program a time based autonomous program in an iterative robot base class? More specifically, could anyone show me what an example code would look like if I for example wanted to make my tankdrive, four motor robot, drive forward for two seconds and then turn for one second and then stop? Any help would be greatly appreciated. |
Re: How to program autonomous
Read about the Timer Class.
Set a timer when you start your motors. Each loop (autonomous periodic), check the timer. When you reach the desired time mark, do something. FYI: You might also want to put encoders on your motors, and check the distance (revolutions) the encoders say you went. |
| All times are GMT -5. The time now is 08:27 AM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi