Programming 3-Wire Servos


#1

I was wondering how do you code a 3-Wire servo for an arm control during driver control, is it the same code as a 393 motor?


#2

Well, mostly. You can either use the port as though it has a motor attached, and use your favorite way to control a motor:


// treat servo port like a motor
// set servo to most backward position
motor[myServoPort] = -127
// natural language method
startMotor(myServoPort, -127);

Or you can use the Natural Language function to set the servo position:

// treat servo port as a servo
// set servo to most backward position
setServo(myServoPort, -127);

Range is -127 to 127; zero is (obviously) the center position.