NIT Fukui / Serial6050Yaw

Dependents:   R1Arobo_Maika_B 2021Arobo_UMAPYOI 2021Arobo_YUMIPYOI

Serial6050.h

Committer:
yopcyuuu
Date:
2018-09-26
Revision:
1:97a3a91ce950
Parent:
0:c3d09c97649b
Child:
2:00a8daf9203b

File content as of revision 1:97a3a91ce950:

#pragma once
#include "mbed.h"

#define ERROR -10000

enum axis {
    YAW,
    PITCH,
    ROLL
};

class Serial6050
{
private:
    RawSerial serial;
    DigitalOut rst;
    int resetValue;
    void intReceive() {
        lower = serial.getc();
    }
public:
    Serial6050(PinName tx, PinName rx, PinName reset);
    void init();
    void reset();
    volatile char lower;
    volatile char higher;
    float read();
};