Library for Pololu Maestro Servo Controller http://www.pololu.com/docs/0J40
Library for Pololu Maestro Servo Controller
Library docs: https://developer.mbed.org/users/kochansky/code/Maestro/docs/f374c7b60318/classMaestro.html
Example usage:
#include "mbed.h" #include "Maestro.h" Maestro maestro(PTC4,PTC3); int main() { maestro.setBaudRate(9600); // limit speed for each servo for (uint8_t i = 0; i < 17; i++) { maestro.setSpeed(i, 10); } while (true) { // set servo on channel 0 to 90 degrees maestro.setServoAngle(0, 90); wait(2); // set servo on channel 0 to 45 degrees maestro.setServoAngle(0, 45); wait(2); } }
Serial commands based on manual: http://www.pololu.com/docs/0J40/5.e
Device pinout:
Diff: Maestro.h
- Revision:
- 9:a15ea85b40ca
- Parent:
- 8:c952ac46bd39
diff -r c952ac46bd39 -r a15ea85b40ca Maestro.h --- a/Maestro.h Tue Jan 07 18:35:25 2014 +0000 +++ b/Maestro.h Mon Aug 25 19:22:10 2014 +0000 @@ -124,6 +124,13 @@ * @param speed - speed of the servo in units of 0.25 us / (10 ms) */ void setSpeed(uint8_t channel, uint16_t speed); + + /** + * Limits the speed at which all servos channels output value changes + * + * @param speed - speed of the servo in units of 0.25 us / (10 ms) + */ + void setSpeed(uint16_t speed); /** * Limits the acceleration of a servo channel's output @@ -132,6 +139,13 @@ * @param acceleration - acceleration of the servo in units of (0.25 us) / (10 ms) / (80 ms) */ void setAcceleration(uint8_t channel, uint16_t acceleration); + + /** + * Limits the acceleration of all servos channels output + * + * @param acceleration - acceleration of the servo in units of (0.25 us) / (10 ms) / (80 ms) + */ + void setAcceleration(uint16_t acceleration); /** * Sets the PWM output to the specified on time and period