View Single Post
  #1   Spotlight this post!  
Unread 12-10-2006, 12:48
jalburty jalburty is offline
Joe Alburty
AKA: Joe Alburty
FRC #1763 (Paseo Pirates)
Team Role: Mentor
 
Join Date: Oct 2006
Rookie Year: 2005
Location: Kansas City
Posts: 25
jalburty will become famous soon enoughjalburty will become famous soon enough
Send a message via ICQ to jalburty
Autonomous tutorial

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.