2021 NHK B

Committer:
tanabe2000
Date:
Tue Sep 18 15:25:05 2018 +0000
Revision:
9:222f7fcbd05a
Parent:
7:73e542a88106
Child:
10:a21aa2bd05c5
???????????????

Who changed what in which revision?

UserRevisionLine numberNew contents of line
UCHITAKE 0:58910ef3f2b0 1 #ifndef OMNI_POSITION_H
UCHITAKE 0:58910ef3f2b0 2 #define OMNI_POSITION_H
UCHITAKE 0:58910ef3f2b0 3
UCHITAKE 0:58910ef3f2b0 4 #include "mbed.h"
tanabe2000 9:222f7fcbd05a 5
tanabe2000 9:222f7fcbd05a 6 #include "SerialMultiByte.h"
UCHITAKE 0:58910ef3f2b0 7
tanabe2000 9:222f7fcbd05a 8 #define FIRST_HEDDER 0xEE
tanabe2000 9:222f7fcbd05a 9 #define SECOND_HEDDER 0xFF
tanabe2000 9:222f7fcbd05a 10 #define BUFFER_SIZE 6
tanabe2000 9:222f7fcbd05a 11 #define TWO_BYTE_DATA 3
tanabe2000 9:222f7fcbd05a 12 #define ONE_BYTE_DATA 0
takeuchi 1:0229fc98a26f 13
tanabe2000 9:222f7fcbd05a 14 class OmniPosition
tanabe2000 9:222f7fcbd05a 15 {
tanabe2000 9:222f7fcbd05a 16 public :
tanabe2000 9:222f7fcbd05a 17 OmniPosition(PinName serialTX, PinName serialRX);
takeuchi 2:edd33d3ad0fd 18
tanabe2000 9:222f7fcbd05a 19 int16_t getX();
tanabe2000 9:222f7fcbd05a 20 int16_t getY();
tanabe2000 9:222f7fcbd05a 21 float getTheta();
takeuchi 2:edd33d3ad0fd 22
tanabe2000 9:222f7fcbd05a 23 void reset();
tanabe2000 9:222f7fcbd05a 24
tanabe2000 9:222f7fcbd05a 25 private :
tanabe2000 9:222f7fcbd05a 26 void assembleLoop();
takeuchi 2:edd33d3ad0fd 27
tanabe2000 9:222f7fcbd05a 28 Thread thread;
takeuchi 1:0229fc98a26f 29
tanabe2000 9:222f7fcbd05a 30 int16_t X;
tanabe2000 9:222f7fcbd05a 31 int16_t Y;
tanabe2000 9:222f7fcbd05a 32 int16_t theta;
takeuchi 2:edd33d3ad0fd 33
tanabe2000 9:222f7fcbd05a 34 bool resetSend;
tanabe2000 9:222f7fcbd05a 35 uint8_t rxdata[BUFFER_SIZE];
tanabe2000 9:222f7fcbd05a 36 int data[TWO_BYTE_DATA + ONE_BYTE_DATA];
tanabe2000 9:222f7fcbd05a 37 SerialMultiByte serial;
UCHITAKE 0:58910ef3f2b0 38 };
UCHITAKE 0:58910ef3f2b0 39
tanabe2000 9:222f7fcbd05a 40 #endif