View Single Post
  #24   Spotlight this post!  
Unread 06-03-2015, 21:58
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
Thank you so much for the help guys, I just ended up doing this:

Code:
double rot = -stick.getX();
double speed = -stick.getY();
myRobot.arcadeDrive(rot*0.5, speed*0.5);
Glad you found a solution.

I would suggest you throw that in a if-else statement though, making the half-speed your default speed:
Code:
if(stick.getRawButton(1))
{
myRobot.arcadeDrive(-stick.getX(),-stick.getY());
}
else
{
double rot = -stick.getX();
double speed = -stick.getY();
myRobot.arcadeDrive(rot*0.5, speed*0.5);
}
This way, if in the middle of a match, your driver decides that he or she needs full speed, they have the ability to do so.

Just a suggestion. Of course, you may already have it that way in the rest of your code!
__________________
1771- Programmer, Captain, Drive Team (2009-2012)
4509- Mentor (2013-2015)
1771- Mentor (2015)