View Single Post
  #3   Spotlight this post!  
Unread 16-01-2006, 17:16
Jake M Jake M is offline
void* Jake;
FRC #1178 (DURT)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Missouri
Posts: 118
Jake M has a spectacular aura aboutJake M has a spectacular aura about
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();
 }