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

Committer:
sillevl
Date:
Sat Dec 19 13:28:17 2015 +0000
Revision:
11:ccb8653e285f
Parent:
7:9068fc754a0b
Child:
13:d6374484b953
add reporter interface

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sillevl 7:9068fc754a0b 1 #pragma once
sillevl 7:9068fc754a0b 2
sillevl 11:ccb8653e285f 3 #include "reporter.h"
sillevl 7:9068fc754a0b 4 #include "mbed.h"
sillevl 7:9068fc754a0b 5 #include "MbedJSONValue.h"
sillevl 7:9068fc754a0b 6 #include "M3Dpi.h"
sillevl 7:9068fc754a0b 7
sillevl 7:9068fc754a0b 8 // TODO: only report if value is different?
sillevl 11:ccb8653e285f 9 class JsonReporter : public Reporter
sillevl 7:9068fc754a0b 10 {
sillevl 7:9068fc754a0b 11 mbed::Stream* out;
sillevl 7:9068fc754a0b 12 const char* id;
sillevl 7:9068fc754a0b 13 public:
sillevl 7:9068fc754a0b 14 JsonReporter(mbed::Stream* _out, const char _id[]);
sillevl 11:ccb8653e285f 15
sillevl 11:ccb8653e285f 16 virtual void time(time_t seconds);
sillevl 11:ccb8653e285f 17 virtual void distance(m3dpi::Distance distance);
sillevl 11:ccb8653e285f 18 virtual void acceleration(m3dpi::Acceleration acc);
sillevl 11:ccb8653e285f 19 virtual void direction(m3dpi::Direction direction);
sillevl 11:ccb8653e285f 20 virtual void rotation(m3dpi::Rotation rotation);
sillevl 11:ccb8653e285f 21
sillevl 11:ccb8653e285f 22 protected:
sillevl 7:9068fc754a0b 23 MbedJSONValue* jsonFactory();
sillevl 7:9068fc754a0b 24 void print(MbedJSONValue* json);
sillevl 7:9068fc754a0b 25 };