добавлена библиотека servo, прерывание для нее и дефайны по времени

This commit is contained in:
klassents committed 2024-10-03 10:09:18 +07:00
1 parent 63217147e5
commit 2dc71c2171
11 files changed
+943

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
/*
"Jerks"
This example demonstrates the servo drive movement
with a sharp stop in both directions
(the example was tested on a servo drive with a circular motion)
*/
#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
}