Maestro Servo Controller library
|
Version: 1.0.0
Release date: 2015 Jan 12
www.pololu.com
This is a library for the Arduino IDE that helps interface with a Maestro Servo Controller. It communicates with Maestros using the Serial Protocol described in the Maestro Servo Controller User's Guide Section 5, "Serial Interface".
This library is designed to work with the Arduino IDE versions 1.0.x and 1.5.x, and will probably not work with older versions.
This library supports any Arduino-compatible board.
The Maestro Servo Controllers can be purchased from Pololu's website. Before continuing, careful reading of the Maestro Servo Controller User's Guide is recommended.
The minimal connections required for using this library are:
Arduino TX pin (see table below) - Maestro RX Arduino GND - Maestro GND
The example sketches try to use a hardware serial port on your Arduino if one is available. The one used is defined by SERIAL_PORT_HARDWARE_OPEN. The pins for this serial port are different depending on which Arduino you are using.
Microcontroller Board | Hardware serial? | MCU RX pin | MCU TX pin |
---|---|---|---|
A-Star 32U4 | Yes | 0 | 1 |
Arduino Leonardo | Yes | 0 | 1 |
Arduino Micro | Yes | 0 | 1 |
Arduino Mega 2560 | Yes | 19 | 18 |
Arduino Due | Yes | 19** | 18 |
Arduino Uno | No | 10 | 11 |
Arduino Yun | No | 10 | 11 |
If you would like to read information from the Maestro, like in the Input example sketch, you need to make one additional connection:
Arduino RX (see table above) - Maestro TX
** The Due's serial port is 3.3 V, so it should not be directly connected to the Maestro's 5 V TX line. A voltage divider or level shifter can be used.
Before using the example sketches, you should go to the Serial Settings tab in the Maestro Control Center and apply these settings:
Download the maestro-arduino library from GitHub, decompress it, and drag the "PololuMaestro" folder into the "libraries" subdirectory inside your Arduino sketchbook directory. You can view your sketchbook location by selecting File->Preferences in the Arduino environment. If there is not already a "libraries" folder in that location, you should create it yourself. After installing the library, restart the Arduino environment. Example code for using this library can be found in the File->Examples menu.
Several example sketches are available that show how to use the library. You can access them from the Arduino IDE by opening the "File" menu, selecting "Examples", and then selecting "PololuMaestro". If you cannot find these examples, the library was probably installed incorrectly and you should retry the installation instructions above.
For complete documentation of this library, including many features that were not mentioned here, see the maestro-arduino documentation.