View Single Post
  #8   Spotlight this post!  
Unread 13-11-2003, 21:20
GregTheGreat's Avatar
GregTheGreat GregTheGreat is offline
Registered User
no team
 
Join Date: Jan 2003
Rookie Year: 2002
Location: USA
Posts: 386
GregTheGreat has a spectacular aura aboutGregTheGreat has a spectacular aura aboutGregTheGreat has a spectacular aura about
Quote:
Originally posted by 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)
that looks right, (just agreeing) usually problems with programs are variables are not defined, or bits on on, etc. or programs that get caught in loops, emitting certain parts.

Check the obvious before changing the program.
Did you debug?

-Greg The Great