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
Diff: main.cpp
- Revision:
- 9:5292bf545459
- Parent:
- 8:5c0833506d67
- Child:
- 10:a5f43326e0b0
--- a/main.cpp Fri Dec 11 10:40:40 2015 +0000 +++ b/main.cpp Wed Dec 16 13:27:43 2015 +0000 @@ -7,7 +7,7 @@ M3Dpi robot; Serial pc(USBTX,USBRX); -JsonReporter report(&pc, M3DPI_ID); +JsonReporter report(&robot.xbee, M3DPI_ID); static float r_wheel = 0.0; static float l_wheel = 0.0; @@ -41,8 +41,8 @@ void read_commands_thread(void const *args) { - if(pc.readable()){ - char command = pc.getc(); + if(robot.xbee.readable()){ + char command = robot.xbee.getc(); switch(command){ case 'l': // Left