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

Committer:
sillevl
Date:
2015-12-03
Revision:
7:9068fc754a0b
Child:
8:5c0833506d67
Child:
11:ccb8653e285f

File content as of revision 7:9068fc754a0b:

#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);
};