Racing Robots Session

Dependencies:   MbedJSONValue m3pi

This is the library for the Racing Robots session. It supports the M3PI robot of Polulu.

It is based on the "Arduino" principle of the init and loop function.

Just add a main.cpp file which contains:

Racing Robots main file

#include "robot_logic.h"

void init()
{
   //put your initialization logic here
}

void loop()
{
    //put your robot control logic here    
}

Features include:

  1. Controlling the LEDS
  2. Move forward and backward
  3. Turn
  4. Read the sensor values
  5. Use a PID controller
Revision:
9:0385d1bfc38b
Parent:
8:597ce8a7d34b
--- a/robot_logic.h	Mon Jun 01 14:47:32 2015 +0000
+++ b/robot_logic.h	Mon Jun 01 14:53:39 2015 +0000
@@ -110,7 +110,9 @@
 void await(int milliseconds);
 
 /**
- * If using Xbee to start/stop the robot, you can set a unique code to prevent starting or stopping other robots
+ * If using Xbee to start/stop the robot, you can set a unique code to prevent starting or stopping other robots.
+ * To start or stop the robot, send the a json string only containing a "start" or "stop" key with the code as a value.
+ * eg: {"start": 1234} will start the robot with code set to 1234, {"stop": 9876} will stop the robot with code 9876.
  *
  * @param code A number between 0 and 1000.
  */