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:
kudrom
Date:
Fri Dec 11 10:40:40 2015 +0000
Revision:
8:5c0833506d67
Parent:
7:9068fc754a0b
Added battery to the reporter and the commands interface.

Who changed what in which revision?

UserRevisionLine numberNew 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);
kudrom 8:5c0833506d67 21 void battery(float battery);
sillevl 7:9068fc754a0b 22 };