|
Re: Controlling motors
In the defualt code, it goes as such.....
main()->Process_Data_From_Master_uP()->Default_Routine()
The second two can be found in user_routines.c. Default_Routine() is not called from User_Initialization() by default.
If you're using the 'bells and whistles' version of Kevin Watson's camera code, Default_Routine() is probably still commented out.
To use the joysticks, the variables you need are p1_y and p1_x, where 1 is the number of whichever port your joystick is plugged into. The default code includes tank drive through pwm01 and pwm02, by assigning p1_y and p2_y to them, respectively. It also provides single joystick drive through pwm13 and pwm14 for the right wheel, and pwm15 and pwm16 for the left wheel. Although, some problems with this may arise from the fact that PWMs 13 - 16 are generated by the code and not by the microprocessor. If you want to use single joystick drive, I'd recommend assigning the equations that calculate the motor values to another set of PWMs.
__________________
Code:
void function(void)
{
function();
}
|