Log in

View Full Version : Autonomous tutorial


jalburty
12-10-2006, 12:48
Does anyone recall a set of examples on autonomous programming on this website? I saw it a few months ago, but cannot find it again. Several exercises were given demonstrating the use of a counter variable to control the actions of the robot at certain time intervals. It also talked about how to convert from loop intervals to seconds.

For example, it went something like this:
//user_routines.c
int counter;
.
.
void user_routines(void);
int t;
.
.
counter = counter + 1; //loop count
t = (counter / 28); //seconds

if (t < 280) { //go straight for ten seconds
pwm01 = 200;
pwm02 = 200;
{
else if (t > 280) { //turn left at 10 seconds
pwm01 = 200;
pwm02 = 127;
}

etc.

I thought it was a good exercise and would like to use it in a lesson plan.

Thanks.

JamesBrown
12-10-2006, 14:57
http://www.chiefdelphi.com/media/papers/1590

Don't know if that was what you were talking about but it is essentially the same thing. That is saved on all of the computers where we work, it is great to teach new programmers with.

If that doesn't help just post what kind of stuff you are looking for and I am sure some of us could write code for you, it would be alot easier than you doing it all your self.