Skip to content

Commit

Permalink
✨ feature (Single): Added a even simpler example of how to handle jus…
Browse files Browse the repository at this point in the history
…t one servo motor
  • Loading branch information
kevinmarquesp committed Jun 16, 2024
1 parent c64c9fd commit d0f9a33
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions examples/Single/Single.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include <PServo.h>
#include <Servo.h>

#define __SERVO_PIN 7

unsigned long timer = 0;

ps::PServo myservo_machine(&timer);
Servo myservo;

void setup(void) {
myservo.attach(__SERVO_PIN);

Serial.begin(9600);
}

void loop(void) {
timer = millis();

myservo.write(myservo_machine.get_props().pos);

myservo_machine.begin()
->move(90, 15)
->move(180, 40)
->move(0, 30)
->move(180, 10)
->move(0, 10);
}

0 comments on commit d0f9a33

Please sign in to comment.