View Single Post
  #5   Spotlight this post!  
Unread 04-02-2007, 19:43
Salik Syed Salik Syed is offline
Registered User
FRC #0701 (RoboVikes)
Team Role: Alumni
 
Join Date: Jan 2003
Rookie Year: 2001
Location: Stanford CA.
Posts: 514
Salik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud of
Send a message via AIM to Salik Syed
Re: Code to have speed of motors dependent on how hard you push the joystick

The joysticks output a value between 0 and 255 based on how far the joystick is pulled back. 0 is full back, 255 is full forward, 127 is neutral.
The speed of the motor is controlled using PWM, all you really need to know is that 0 is full back, 255 full forward, and 127 neutral.
Assuming your motor has fairly linear Power vs. RPM curve you should see a fairly linear response if you just do something like this:
PWM = joystick.
__________________
Team 701