teamALI / Mbed 2 deprecated HB2018

Dependencies:   mbed FreeRTOS

Imu.h

Committer:
takeru0x1103
Date:
2018-12-05
Revision:
19:4b0fe9a5ec38
Parent:
18:5aa48aec9cae
Child:
25:f3a6e7eec9c3

File content as of revision 19:4b0fe9a5ec38:

#ifndef __IMU_H__
#define __IMU_H__

#include <iostream>
#include <vector>
#include <string>
#include <sstream>
using namespace std;
#include "mbed.h"
#include "typedef.h"

const float cGYRO_RESO=131.0;


class Imu {
private:
    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