library for omnidirectional planar positioning system

Dependents:   measuring_wheel 2018NHK_gakugaku_robo 2018NHK_gaku_ver2

OmniPosition.h

Committer:
takeuchi
Date:
2018-06-30
Revision:
1:0229fc98a26f
Parent:
0:58910ef3f2b0
Child:
2:edd33d3ad0fd

File content as of revision 1:0229fc98a26f:

#ifndef OMNI_POSITION_H
#define OMNI_POSITION_H

#include "mbed.h"
#include "CycleInt.h"

#define SERIAL_BUFFER_SIZE 8
#define HEADER_FIRST_BYTE 0xAA
#define HEADER_SECOND_BYTE 0xBB
#define RECEIVE_FREQ (1.0/500.0)
#define DEFAULT_BAUD 115200

class OmniPosition : public RawSerial {
    public :
        OmniPosition(PinName serialTX, PinName serialRX);
    
    private :
        void readData();
        void assemble();

        CycleInt readCounter;
        CycleInt takeCounter;
        Ticker ticker;

        char *buffer;

        bool headerCheck;
        int headerPoint;
};

#endif