View Single Post
  #6   Spotlight this post!  
Unread 17-02-2013, 21:17
MagiChau's Avatar
MagiChau MagiChau is offline
Registered User
AKA: Michael Chau
FRC #0085 (B.O.B. (Built on Brains))
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Zeeland, Michigan
Posts: 875
MagiChau is just really niceMagiChau is just really niceMagiChau is just really niceMagiChau is just really nice
Re: Programming a super shifter/gearbox

Quote:
Originally Posted by tmccalister View Post
Thank you so much sir. You are a gentleman and a scholar so...

Servo supershifter = new servo (1); ?
Then how would I set it to change between gears?
I myself use the set() method so here's some java pseudo code for controlling it with joystick buttons. This assumes you want the servo to go through the full range of motion from 0 to 1. There is also a setAngle() method you could use.

Code:
if (buttonIsPressed()) {
    servo.set(1);
} else if (anotherButtonIsPressed()) {
    servo.set(0);
}
Reply With Quote