View Single Post
  #12   Spotlight this post!  
Unread 11-05-2005, 16:01
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: One Joystick Drive

A couple of simple issues.
  • The code for joystick control is in the Default_Routine() a few lines below the Process_Data_From_Master_uP routine(). The 1-Joystick code starts there on line 226 (in the version I attached). (In MPLAB look under Edit -> Properties and check "line numbers" if you don't already see them.)
  • There was a ". . ." in my example above that isn't code and needs to be removed (sorry about that).
  • Set both the MOTOR_CORRECTION's to zero to begin with. You'll only need to adjust those values if the operator cannot manually correct for the robot pulling to one side or the other. I don't know how hard it will be for your operator to see the robot underwater.
  • Make sure your drive motor pwms are connected to pwm 13 (right motor) and pwm 15 (left motor).
I've attached a modified version, so you can see what I meant.
the new code is at lines 204-205 and 239-255.
What you wrote originally will actually work, but would be confusing to anyone reading the code, because it does all the joystick work in Default_Routine() then overrides it all in Process_Data_From_Master_uP().

Anyone else have comments to add?
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 11-05-2005 at 16:33.