View Single Post
  #2   Spotlight this post!  
Unread 13-02-2016, 10:13
Jalerre's Avatar
Jalerre Jalerre is offline
Registered User
FRC #4965 (FIRE)
Team Role: Alumni
 
Join Date: Apr 2014
Rookie Year: 2013
Location: Anderson, SC
Posts: 147
Jalerre is on a distinguished road
Re: How to SetThrottle

If I understand this correctly, you are trying to use the throttle on your joystick to control the speed of your motor. To do this you need to create a method to change value of the throttle from -1-1 to 0-1 using some simple math. Specifically you'd need to add one to the output of the throttle then divide by two. You then multiply this new value by the number you input as the speed for the motor controller. If you are using a joystick to control the motor, this will limit the speed of your motor but still give you the full range of the joystick. If you need some example code, I can provide it.
__________________
Vex
2013: 415 - Fabrication, Programming, Electrical
2014: 415D - Captain, Programming Lead
FTC
2014: 7354 - Programming Lead
FRC
2013: 415 - Safety Animation, Fabrication
2014-2015: 4965 - Programming & Electrical
2016: 4965 - Captain, Programming Lead, Electrical