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

Revision:
7:9068fc754a0b
Child:
8:5c0833506d67
Child:
11:ccb8653e285f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/jsonReporter.h	Thu Dec 03 17:53:04 2015 +0000
@@ -0,0 +1,21 @@
+#pragma once
+
+#include "mbed.h"
+#include "MbedJSONValue.h"
+#include "M3Dpi.h"
+
+// TODO: only report if value is different?
+class JsonReporter
+{
+    mbed::Stream* out;
+    const char* id;
+public:
+    JsonReporter(mbed::Stream* _out, const char _id[]);
+    MbedJSONValue* jsonFactory();
+    void print(MbedJSONValue* json);
+    void time(time_t seconds);
+    void distance(m3dpi::Distance distance);
+    void acceleration(m3dpi::Acceleration acc);
+    void direction(m3dpi::Direction direction);
+    void rotation(m3dpi::Rotation rotation);
+};
\ No newline at end of file