You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Servo_Hardware_PWM.h
+15-11Lines changed: 15 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -69,19 +69,23 @@ class Servo
69
69
{
70
70
public:
71
71
Servo();
72
-
uint8_tattach(int pin); //attach the given pin; returns servoIndex number or 255 if too many servos
73
-
uint8_tattach(int pin, int min, int max); //attach the given pin and set the upper and lower pulse width limits; returns servoIndex number or 255 if too many servos
72
+
uint8_tattach(int pin); //attach the given pin; returns servoIndex number or 255 if too many servos
73
+
uint8_tattach(int pin, int min, int max); //attach the given pin and set the upper and lower pulse width limits; returns servoIndex number or 255 if too many servos
74
74
uint8_tattach(int pin, int min, int max, int defaultPos); //attach the given pin, set the upper and lower pulse width limits and set the pulse width when servo is attached; returns servoIndex number or 255 if too many servos
75
-
voiddetach(); //detach the used pin
76
-
voiddetachAll(); //automatically detaches all used pins
77
-
voidwrite(int value); //write angle in degrees
78
-
voidwriteMicroseconds(int value); //write pulse width in microseconds
75
+
voiddetach(); //detach the used pin
76
+
voiddetachAll(); //automatically detaches all used pins
77
+
voidwrite(int value); //write angle in degrees
78
+
voidwriteMicroseconds(int value); //write pulse width in microseconds
79
+
intread(); //returns the current write angle in degrees
80
+
intreadMicroseconds(); //returns the current write angle in microseconds
81
+
79
82
private:
80
-
uint8_t servoIndex; //number of attached Servos
81
-
uint8_t servoPin; //pin number of the attached Servo
82
-
uint16_t min; //lower pulse width limit
83
-
uint16_t max; //upper pulse width limit
84
-
uint16_t defaultPos; //pulse width when servo is attached
83
+
uint8_t servoIndex; //number of attached Servos
84
+
uint8_t servoPin; //pin number of the attached Servo
85
+
uint16_t min; //lower pulse width limit
86
+
uint16_t max; //upper pulse width limit
87
+
uint16_t defaultPos; //pulse width when servo is attached
0 commit comments