teamALI / Mbed 2 deprecated HB2018

Dependencies:   mbed FreeRTOS

Revision:
18:5aa48aec9cae
Parent:
17:f9610f3cfa1b
Child:
19:4b0fe9a5ec38
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Imu.h	Sat Dec 01 14:03:08 2018 +0000
@@ -0,0 +1,37 @@
+#ifndef __IMU_H__
+#define __IMU_H__
+
+#include <iostream>
+#include <vector>
+#include <string>
+#include <sstream>
+using namespace std;
+#include "mbed.h"
+#include "typedef.h"
+
+class Imu {     
+private:
+    const float cGYRO_RESO=131.0;
+    Serial  sp46Axis;    //
+    INT16   gyroZ;
+    INT16   gyro_ref;
+    float   yaw;
+    float   yaw_ref;
+    float   yawOfset;
+    
+    //
+    void PushBuf(UCHAR rxChar);
+    void uartRxIntHndler46Axis();
+    float wrapAroungGuard(float iYaw);
+public:
+    Imu(PinName pinTx, PinName pinRx);
+    virtual     ~Imu();
+    float       GetGyroZ();
+    float       GetYaw();
+    void        CalYaw();
+    void        CalGyro();
+};
+
+#endif
+
+