View Single Post
  #26   Spotlight this post!  
Unread 16-03-2015, 01:16
nighterfighter nighterfighter is offline
1771 Alum, 1771 Mentor
AKA: Matt B
FRC #1771 (1771)
Team Role: Mentor
 
Join Date: Sep 2009
Rookie Year: 2007
Location: Suwanee/Kennesaw, GA
Posts: 835
nighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant future
Re: Limit speed of 4 chassis CIM motors

Quote:
Originally Posted by microman1934 View Post
Thanks for the idea, would the throttle work for that as well?
Yes. You could set the throttle to act as a toggle switch...

I'm on my phone so I can't format this correctly and can only give some pseudo code.

If(stick.getThrottle () > 0)
myRobot.Drive (halfSpeedValues);

else if(stick.getThrottle <= 0)
myRobot.Drive (fullSpeedValues);

Remember the throttle on the joystick ranges from -1 to 1, so 0 will be in the middle.
__________________
1771- Programmer, Captain, Drive Team (2009-2012)
4509- Mentor (2013-2015)
1771- Mentor (2015)