teamALI / Mbed 2 deprecated HB2018

Dependencies:   mbed FreeRTOS

Gyro.h

Committer:
MasashiNomura
Date:
2018-11-27
Revision:
14:76a56d517103
Parent:
9:557628b373ea
Child:
16:05b9e44889f1

File content as of revision 14:76a56d517103:

#ifndef GYRO_H
#define GYRO_H

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

class Gyro {
    /*
     * Varialbles
     */
#define BAUD_RATE4_6AXIS   115200
    private:

    Serial sp46Axis;
    float   accZ;
    float   gyroZ;
    float   yaw;
    float   yaw_ref;
    /*
     * functions
     */
    std::vector<std::string> split(const std::string &str, char sep);
    void PushBuf(UCHAR rxChar);
    void uartRxIntHndler46Axis();
public:
    Gyro(PinName pinTx, PinName pinRx);
    virtual ~Gyro();
    float   GetAngularRate();
    float   GetAccel();
    float   GetAngle();
    void    SetYawRef();
    
};

#endif /* GYRO_H */