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)