A library to read from an Epson IMU
Diff: USBIMU.h
- Revision:
- 1:a2b5b17c949d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/USBIMU.h Fri Dec 13 10:58:02 2013 +0000 @@ -0,0 +1,40 @@ +#ifndef USBIMU_H +#define USBIMU_H + +#include "mbed.h" +#include "USBHostSerial.h" + +#define TEMP_OUT 0x02 +#define XGYRO_OUT 0x04 +#define YGYRO_OUT 0x06 +#define ZGYRO_OUT 0x08 +#define XACCL_OUT 0x0A +#define YACCL_OUT 0x0C +#define ZACCL_OUT 0x0E + +#define CR 0x0D + + +class USBIMU { + + public: + USBIMU(); + ~USBIMU(); + signed int getParam(unsigned char par); + float getScaledParam(unsigned char par); + bool getFaulty(); + + + private: + USBHostSerial *s_; + bool faulty; + + void init(USBHostSerial *s); + bool isReady(); + bool isFaulty(); + void goToStartOfSentence(unsigned char par); + + +}; + +#endif \ No newline at end of file