View Single Post
  #5   Spotlight this post!  
Unread 25-01-2002, 20:29
srawls's Avatar
srawls srawls is offline
Registered User
#0122 (Nasa Knights)
 
Join Date: Dec 2001
Location: Yorktown
Posts: 507
srawls is an unknown quantity at this point
Send a message via AIM to srawls
Well, just connect the pot to the motor, and the value you get is the position of the motor. Calibrate the pot however you want, but you need to find the values of the limits (the two position values that define the 90 degree turn). Then just put an abstraction in where the button (or joystick) no longer tells the motor to go a certain speed, but it tells it to go to a certain position, then have an equation to figure out how fast to move the motor taking into account the current position and the position the button (or joystick) wants the motor to move. Then all you have to do is max and min the 'position' to the limits found earlier.

I hope that made sense, if not than it's just the ramblings of a 16 year old programmer who still has flashbacks of late nights trying to fix the robot code

Stephen