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/jsonReporter.h@7:9068fc754a0b, 2015-12-03 (annotated)
- Committer:
- sillevl
- Date:
- Thu Dec 03 17:53:04 2015 +0000
- Revision:
- 7:9068fc754a0b
- Child:
- 8:5c0833506d67
- Child:
- 11:ccb8653e285f
add json reporter class
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sillevl | 7:9068fc754a0b | 1 | #pragma once |
sillevl | 7:9068fc754a0b | 2 | |
sillevl | 7:9068fc754a0b | 3 | #include "mbed.h" |
sillevl | 7:9068fc754a0b | 4 | #include "MbedJSONValue.h" |
sillevl | 7:9068fc754a0b | 5 | #include "M3Dpi.h" |
sillevl | 7:9068fc754a0b | 6 | |
sillevl | 7:9068fc754a0b | 7 | // TODO: only report if value is different? |
sillevl | 7:9068fc754a0b | 8 | class JsonReporter |
sillevl | 7:9068fc754a0b | 9 | { |
sillevl | 7:9068fc754a0b | 10 | mbed::Stream* out; |
sillevl | 7:9068fc754a0b | 11 | const char* id; |
sillevl | 7:9068fc754a0b | 12 | public: |
sillevl | 7:9068fc754a0b | 13 | JsonReporter(mbed::Stream* _out, const char _id[]); |
sillevl | 7:9068fc754a0b | 14 | MbedJSONValue* jsonFactory(); |
sillevl | 7:9068fc754a0b | 15 | void print(MbedJSONValue* json); |
sillevl | 7:9068fc754a0b | 16 | void time(time_t seconds); |
sillevl | 7:9068fc754a0b | 17 | void distance(m3dpi::Distance distance); |
sillevl | 7:9068fc754a0b | 18 | void acceleration(m3dpi::Acceleration acc); |
sillevl | 7:9068fc754a0b | 19 | void direction(m3dpi::Direction direction); |
sillevl | 7:9068fc754a0b | 20 | void rotation(m3dpi::Rotation rotation); |
sillevl | 7:9068fc754a0b | 21 | }; |