View Single Post
  #7   Spotlight this post!  
Unread 13-11-2003, 21:16
Noah's Avatar
Noah Noah is offline
Code Monkey
#0861 (The Gondobots)
Team Role: Programmer
 
Join Date: Apr 2002
Location: Venice, California
Posts: 139
Noah has a spectacular aura aboutNoah has a spectacular aura about
Send a message via AIM to Noah
ok, it goes something like this (in my mind)

1. Check to see if the autonomous_mode bit is set. You may opt to skip this part while testing your auto-code, or alternatively you can try this .

2. The output variables for the PWM outputs are PWM01 - PWM08. A simple statement like
PWM01 = 255;
PWM02 = 255;
should work.

3. You might try creating functions such as
go_forward()
{
PWM01 = 255;
PWM02 = 255;
}
turn_right()
{
PWM01 = 255;
PWM02 = 0;
}

and such. Something I suggest even more is that you create your own aliases in alias.h in ways such as

#define leftDriveMotor PWM01
#define rightDriveMotor PWM02

and then use the leftDriveMotor and rightDriveMotor variables in all of your autonomous code. That way, when your electrical guy accidentally misreads the schematics and plugs the left motor into PWM 2 and the team decides its a software bug, it's all of three keystrokes to rectify. (This seems to happen a lot in my team... grrr)
__________________
"It's broken? NOOAAHH!!! This is your doing, isn't it!"

"We can fix it in the software!"
"It's a BROKEN GEAR!"