apuntes_Arduino/motores/servo/servo_joystick/servo_joystick.ino

30 lines
484 B
Arduino
Raw Normal View History

2021-01-05 00:15:16 -03:00
#include <Servo.h>
Servo myservo_X;
void setup() {
myservo_X.attach(9);
Serial.begin(115200);
}
void loop() {
/*
for (byte j=20; j<140; j++){
myservo_X.write(j);
Serial.print("up j=");
Serial.println(j);
delay(25);
}
for (byte i=140; i>20; i--) {
myservo_X.write(i);
Serial.print("down i= ");
Serial.println(i);
delay(25);
}
*/
myservo_X.write(115);
delay(1000);
myservo_X.write(45);
delay(1000);
}