A library to read from an Epson IMU
Diff: IMU.h
- Revision:
- 0:b4479b51578c
- Child:
- 1:a2b5b17c949d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/IMU.h Thu Nov 28 15:14:40 2013 +0000 @@ -0,0 +1,43 @@ +#ifndef IMU_H +#define IMU_H + +#include "mbed.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 + +#define BAUDRATE 57600 + + +class IMU { + + public: + IMU(PinName tx, PinName rx); + ~IMU(); + signed int getParam(unsigned char par); + float getScaledParam(unsigned char par); + + + private: + Serial *s_; + bool faulty; + + void init(Serial *s); + bool isReady(); + bool isFaulty(); + void goToStartOfSentence(unsigned char par); + + + + +}; + +#endif \ No newline at end of file