/* JrkSerial.h -- library for Pololu Jrk Motor Controller operating in UART Serial Mode, with the Arduino using hardware serial communication via digital pins 0 and 1. Created by Robin Sharp, June 2014. Released into the public domain. */ #ifndef JrkSerial_h #define JrkSerial_h #include "Arduino.h" class JrkSerial { public: JrkSerial(); ~JrkSerial(); enum variable{input,target,feedback,sfeedback,errorsum,DCtarget,DCvalue}; int motorOff(); int getPosition(); void setPosition(const unsigned setpoint); void setLimits(const int posMin, const int posMax); int getVariable(const variable command); int getErrors(); int getHaltErrors(); private: int _posMin; int _posMax; int _currentpos; int get2byteResponse(); }; #endif