Skip to content

Commit

Permalink
Update Servo-Motor-Module.h
Browse files Browse the repository at this point in the history
Signed-off-by: Adrian <76214766+adrian2793@users.noreply.github.com>
  • Loading branch information
adrian2793 committed Dec 7, 2023
1 parent df962d2 commit 6860119
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Servo-Motor-Module.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
#include <Servo.h>

struct ServoMotor {
struct Servo2 {
int servo;
int angle;
move(int angle);
} ServoMotor;
attach(int pin);
} Servo2;

Servo servo;

void ServoMotor::move(int angle) {
void Servo2::move(int angle) {
this.angle = angle;
servo.attach(this.servo);
servo.write(angle);
}

void Servo2::attach(int pin) {
servo.attach(this.servo);
}

0 comments on commit 6860119

Please sign in to comment.