Skip to content

Commit 184e6fb

Browse files
authored
Update functions_explained.adoc
1 parent fc443ee commit 184e6fb

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

extras/functions_explained.adoc

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@ The functions of the library are:
44

55
**attach(pin)** -- Attaches a servo motor to an i/o pin. (only **pin 2, 3, 7, 8, 44,** and **45**)
66

7-
**writeMicroseconds(us)** -- Sets the servo pulse width in microseconds. (usable range between **500**us and **2500**us)
7+
**attach(pin, min, max)** -- Attaches a servo motor to an i/o pin with a custom lower and upper pulse width limit.
8+
9+
**attach(pin, min, max, defaultPos)** -- Attaches a servo motor to an i/o pin with a custom lower and upper pulse width limit. In addition the starting pulse width of the servo can be set with the defaultPos. This allows the servo to start from a user defined angle instead of the middle position.
810

911
**detach()** -- Clears the used registers and stops the output of the attached pin. (**no pin number!**)
12+
13+
**detachAll()** -- Clears the used registers and stops the output of ALL attached pins. (**no pin number!**)
14+
15+
**write(degrees)** -- Sets the servo angle in degrees. (usable range between 0° and 180°)
16+
17+
**writeMicroseconds(us)** -- Sets the servo pulse width in microseconds. (standard usable range between **500**us and **2500**us)
18+
19+
**read()** -- Returns the current angle (in degrees) that gets transmitted to the servo. (return datatype: **int**)
20+
21+
**readMicroseconds()** -- Returns the current angle (in microseconds) that gets transmitted to the servo. (return datatype: **int**)
22+
23+
**attached()** -- Returns **true** if the servo is attached, otherwise the return value is **false**. (return datatype: **bool**)

0 commit comments

Comments
 (0)