Skip to content

Commit 6860119

Browse files
authored
Update Servo-Motor-Module.h
Signed-off-by: Adrian <[email protected]>
1 parent df962d2 commit 6860119

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/Servo-Motor-Module.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
#include <Servo.h>
22

3-
struct ServoMotor {
3+
struct Servo2 {
44
int servo;
55
int angle;
66
move(int angle);
7-
} ServoMotor;
7+
attach(int pin);
8+
} Servo2;
89

910
Servo servo;
1011

11-
void ServoMotor::move(int angle) {
12+
void Servo2::move(int angle) {
1213
this.angle = angle;
13-
servo.attach(this.servo);
1414
servo.write(angle);
1515
}
16+
17+
void Servo2::attach(int pin) {
18+
servo.attach(this.servo);
19+
}

0 commit comments

Comments
 (0)