neilang / maestro-wrapper

C++ Wrapper for Pololu Maestro Servo Controller

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

C++ Wrapper for Pololu Maestro Servo Controller

Extension of the Cross-platform C example into a C++ wrapper which implements the full serial servo command protocol.

Only tested on OS X and Linux.

Sample code

This is an example of how to use this library:

#include "maestro.h"

#ifdef __APPLE__
#define MAESTRO_DEVICE "/dev/cu.usbmodem00065291"
#else
#define MAESTRO_DEVICE "/dev/ttyACM0"
#endif

using namespace std;

int main(int argc, const char * argv[])
{
    try
    {
        Maestro maestro(MAESTRO_DEVICE);

        Servo horizontalServo(0, 3968, 9216);

        maestro.goHome(&horizontalServo);

    } catch (std::exception& e)
    {
        cout << e.what() << endl;
    }

    return EXIT_SUCCESS;
}

Contributors

About

C++ Wrapper for Pololu Maestro Servo Controller

License:MIT License


Languages

Language:C++ 100.0%