|
1 | 1 | /* |
2 | 2 | Servo_Hardware_PWM.h - This Library allows Arduino/Genuino Mega boards to control up to 6 servos with the integrated 16-bit hardware PWM timer/counter. |
3 | 3 | Created by Daniel Duller, 11. January, 2019. |
4 | | - Changed by Daniel Duller, 14. January, 2019. |
| 4 | + Changed by Daniel Duller, 11. October, 2019. |
5 | 5 |
|
6 | 6 | ############################################################################### |
7 | 7 | MIT License |
|
44 | 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 | 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. |
| 47 | + In addition, the starting pulse width of the servo can be set with the defaultPos. |
48 | 48 | This allows the servo to start from a user-defined angle instead of the middle position. |
49 | 49 |
|
50 | 50 | detach() --- Clears the used registers and stops the output of the attached pin. (no pin number!) |
|
71 | 71 | #error "This library only supports boards with an AVR processor." |
72 | 72 | #endif |
73 | 73 |
|
74 | | -#define VERSION 1.0.1 //software version of this library |
| 74 | +#define Servo_VERSION 1.0.1 //software version of this library |
75 | 75 |
|
76 | 76 | #define MIN_PULSE_WIDTH 500 //the shortest pulse sent to a servo |
77 | 77 | #define MAX_PULSE_WIDTH 2500 //the longest pulse sent to a servo |
78 | | -#define DEFAULT_PULSE_WIDTH 0 //default pulse width when servo is attached |
| 78 | +#define DEFAULT_PULSE_WIDTH 1500 //default pulse width when servo is attached |
79 | 79 | #define MAX_TIMER_COUNT 40000 //the timer TOP value (for creating 50Hz) |
80 | 80 |
|
81 | 81 | #define MAX_SERVOS 6 //6 Servos can be attached |
|
0 commit comments