View Single Post
  #2   Spotlight this post!  
Unread 10-12-2003, 09:15
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,801
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: EDU robot programming

Quote:
Originally Posted by AlphaOmega870
How would I go about changing the default program from single joy stick control to two joy stick control?
In 1-joystick drive the code mixes the x/y on the one joystick. For 2-joystick drive you just use the y axis on each of 2 joysticks.

Change the following lines in user_routines.c at the top of Default_Routine to get rid of the mixed result and just use the PWM inputs directly.

Original code (get rid of the mixing):
pwm01 = pwm03 = Limit_Mix(2000 + PWM_in1 + PWM_in2 - 127); /* LEFT WHEELS */
pwm02 = pwm04 = Limit_Mix(2000 + PWM_in2 - PWM_in1 + 127); /* RIGHT WHEELS */
pwm01 = pwm03 = 255 - pwm01; /* reverse direction of left side */

New code (just :
pwm01 = pwm03 = 255 - PWM_in2; /* LEFT WHEELS - reverse direction of left side */
pwm02 = pwm04 = PWM_in4; /* RIGHT WHEELS */
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle