30 lines
484 B
C++
Executable File
30 lines
484 B
C++
Executable File
#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);
|
|
}
|