Professional Documents
Culture Documents
Servo servo1;
Servo servo2;
void setup() {
int servoPin = 18; //Analog pin 0 is 18 on Leonardo, for UNO R3 change to 14
pinMode(servoPin,OUTPUT); // sets servoPin as an OUTPUT
//servo1.attach(5, 1000, 2000);
servo1.attach(servoPin);
// SG90 Servo motor parameters
// MIN_PULSE_WIDTH = 1000
// MAX_PULSE_WIDTH = 2000
//servo1.setMaximumPulse(2000);
//servo1.setMinimumPulse(1000);
void loop() {
static int v = 0;
int servoAngle = 0; // servo position in degrees
-1-