Skip to content

Commit 3760e62

Browse files
committed
updated the comments in Servo_Hardware_PWM.h
1 parent f47d83e commit 3760e62

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

src/Servo_Hardware_PWM.h

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,29 @@
3737
3838
The methods are:
3939
40-
Servo --- Class for manipulating servo motors connected to Arduino pins. (max. 6 elements)
40+
Servo --- Class for manipulating servo motors connected to Arduino pins. (max. 6 elements)
4141
42-
attach(pin) --- Attaches a servo motor to an i/o pin. (only pin 2, 3, 7, 8, 44, and 45)
42+
attach(pin) --- Attaches a servo motor to an i/o pin. (only pin 2, 3, 7, 8, 44, and 45)
4343
44-
writeMicroseconds(us) --- Sets the servo pulse width in microseconds. (usable range between 500us and 2500us)
44+
attach(pin, min, max) --- Attaches a servo motor to an i/o pin with a custom lower and upper pulse width limit.
4545
46-
detach() --- Clears the used registers and stops the output of the attached pin. (no pin number!)
46+
attach(pin, min, max, defaultPos) --- Attaches a servo motor to an i/o pin with a custom lower and upper pulse width limit.
47+
In addition, the starting pulse width of the servo can bes set with the defaultPos.
48+
This allows the servo to start from a user-defined angle instead of the middle position.
49+
50+
detach() --- Clears the used registers and stops the output of the attached pin. (no pin number!)
51+
52+
detachAll() --- Clears the used registers and stops the output of ALL attached pins. (no pin number!)
53+
54+
write(degrees) --- Sets the servo angle in degrees. (usable range between 0° and 180°)
55+
56+
writeMicroseconds(us) --- Sets the servo pulse width in microseconds. (usable range between 500us and 2500us)
57+
58+
read() --- Returns the current angle (in degrees) that gets transmitted to the servo. (return type: int)
59+
60+
readMicroseconds() --- Returns the current angle (in microseconds) that gets transmitted to the servo. (return type: int)
61+
62+
attached() --- Returns true if the servo is attached. (return type: bool)
4763
*/
4864

4965
#ifndef Servo_Hardware_PWM_h

0 commit comments

Comments
 (0)