View Single Post
  #8   Spotlight this post!  
Unread 30-01-2006, 00:30
CharlieWilken CharlieWilken is offline
Registered User
#0634 (Robowolves)
 
Join Date: Jan 2002
Location: Van Nuys, CA
Posts: 46
CharlieWilken is an unknown quantity at this point
Re: gyro and shooting angle

Im trying to go with the potentiometer and see what happens. I have spliced a pot onto a PWM cable and stuck it onto the analog input on the robot controller.
When my programmer did a print f stament to read the input we found that it does indeed read from 0 to 1024 in integers.

Question 1
Assuming I want to use the 3 digital inputs on joystick port 4 to get change my angle of shooting to the integers 0, 300 and 400. How would I program this in such a way that it ramps down a little bit when it gets close to its destination so it doesn't overshoot the number due to momentum. I am using a motor and lead screw to change my positions.

Question 2

Is there a way to program the joystick to work with the pot on the angle making ramp to match values so that when the joystick is at rest the ramp is at 0 degrees. When the joystick is all the way back the ramp is at 45 degrees. Assume the pot dial moves ~300 degrees for the 1024 increments that the controller sees.