dev_beta_Servo (#3)

Добавлена библиотека Servo
This commit is contained in:
klassents committed 2024-10-03 08:16:43 +03:00
1 parent 63217147e5
commit a7468870fc
11 files changed
+938

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
/*
"Jerks"
This example demonstrates the servo drive movement
with a sharp stop in both directions
*/
#include <Servo.h>
Servo servo; // create an Servo class instance to control the servo
void setup() {
servo.attach(8); // connecting the servo drive to digital pin 8 (D8)
}
void loop() {
servo.write(0); // command to the servo drive - go to the 0 degree position (clockwise movement)
delay(1000); // wait
servo.write(90); // stop movement
delay(1000); // wait
servo.write(180); // command to the servo drive - move to the 180 degree position (counterclockwise movement)
delay(1000); // wait
servo.write(90); // stop movement
delay(1000); // wait
}