
33Chapter2: Two Degrees of Freedom
STEP 2
Next, we need to program our servos to begin at a specific starting position.
In the next few steps, we’ll see why this is so important. For now, we’re going
to set servo 1, which is connected to digital pin 3, to 90 degrees. Then we’ll
set servo 2, which is connected to digital pin 5, to 180 degrees:
#include <Servo.h>
Servo servoOne;
Servo servoTwo;
void setup() {
servoOne.attach(3);
servoTwo.attach(5);
}
void loop() {
servoOne.write(90);
servoTwo.write(180);
}
STEP 3
Now that we have prepped our motors for installation, it’s
time to construct the wooden base on which all our future
robotic arms will be built. Start ...