|
37 | 37 |
|
38 | 38 | The methods are:
|
39 | 39 |
|
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) |
41 | 41 |
|
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) |
43 | 43 |
|
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. |
45 | 45 |
|
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) |
47 | 63 | */
|
48 | 64 |
|
49 | 65 | #ifndef Servo_Hardware_PWM_h
|
|
0 commit comments