Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
OmniPosition.h
- Committer:
- highfieldsnj
- Date:
- 2019-06-20
- Revision:
- 14:16ee2a638ecb
- Parent:
- 13:913b647071a8
- Child:
- 16:893d1d146757
File content as of revision 14:16ee2a638ecb:
#ifndef OMNI_POSITION_H
#define OMNI_POSITION_H
#include "mbed.h"
#define OP_SERIAL_BUFFER_SIZE 9
#define OP_HEADER_FIRST_BYTE 0xEE
#define OP_HEADER_SECOND_BYTE 0xFF
#define OP_DEFAULT_BAUD 115200
class OmniPosition : public RawSerial {
public:
OmniPosition(PinName serialTX, PinName serialRX);
int16_t getX();
int16_t getY();
float getTheta();
void reset();
private:
DigitalOut debugled;
void receiveByte();
void checkData();
uint8_t buffer[9];
uint8_t bufferSize;
uint8_t bufferPoint;
uint8_t receivedBytes;
int16_t X;
int16_t Y;
int16_t theta;
};
#endif
#ifndef M_PI
#define M_PI 3.14159
#endif