m3Dpi robot, based on the Pololu 3pi and m3pi. m3Dpi has multiple distance sensors, gyroscope, compass and accelerometer sensor to be fully aware of its environment. With the addition of xbee or nrf24n01 module it has wireless communication capabilities.
Dependencies: m3Dpi mbed-rtos mbed MbedJSONValue
lib/binaryReporter.h@13:d6374484b953, 2015-12-19 (annotated)
- Committer:
- sillevl
- Date:
- Sat Dec 19 15:27:15 2015 +0000
- Revision:
- 13:d6374484b953
add binary reporter;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sillevl | 13:d6374484b953 | 1 | #pragma once |
sillevl | 13:d6374484b953 | 2 | |
sillevl | 13:d6374484b953 | 3 | #include "reporter.h" |
sillevl | 13:d6374484b953 | 4 | |
sillevl | 13:d6374484b953 | 5 | class BinaryReporter : public Reporter |
sillevl | 13:d6374484b953 | 6 | { |
sillevl | 13:d6374484b953 | 7 | static const char START = 0x02; |
sillevl | 13:d6374484b953 | 8 | void print(char* data, int size); |
sillevl | 13:d6374484b953 | 9 | |
sillevl | 13:d6374484b953 | 10 | enum COMMAND { |
sillevl | 13:d6374484b953 | 11 | DISTANCE = 10, |
sillevl | 13:d6374484b953 | 12 | DIRECTION = 11, |
sillevl | 13:d6374484b953 | 13 | ROTATION = 13, |
sillevl | 13:d6374484b953 | 14 | ACCELERATION = 14 |
sillevl | 13:d6374484b953 | 15 | }; |
sillevl | 13:d6374484b953 | 16 | |
sillevl | 13:d6374484b953 | 17 | public: |
sillevl | 13:d6374484b953 | 18 | BinaryReporter(mbed::Stream* _out, const char _id[]) : Reporter(_out, _id) {}; |
sillevl | 13:d6374484b953 | 19 | |
sillevl | 13:d6374484b953 | 20 | virtual void time(time_t seconds); |
sillevl | 13:d6374484b953 | 21 | virtual void distance(m3dpi::Distance distance); |
sillevl | 13:d6374484b953 | 22 | virtual void acceleration(m3dpi::Acceleration acc); |
sillevl | 13:d6374484b953 | 23 | virtual void direction(m3dpi::Direction direction); |
sillevl | 13:d6374484b953 | 24 | virtual void rotation(m3dpi::Rotation rotation); |
sillevl | 13:d6374484b953 | 25 | |
sillevl | 13:d6374484b953 | 26 | |
sillevl | 13:d6374484b953 | 27 | }; |