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:
7:a72215b1910b
Parent:
6:0dc4e4225881
Child:
8:597ce8a7d34b
--- a/robot_logic.h	Wed Feb 25 09:10:13 2015 +0000
+++ b/robot_logic.h	Wed Feb 25 15:56:14 2015 +0000
@@ -46,7 +46,7 @@
 
 /**
  * Calibrate the line follow sensors.
- * Take note that the pololu should be placed over the line
+ * Take note that the robot should be placed over the line
  * before this function is called and that it will rotate to
  * both sides.
  */
@@ -72,7 +72,7 @@
 void pid_init(int p, int i, int d);
 
 /**
- * Determine PID turnspeed with which the pololu should
+ * Determine PID turnspeed with which the robot should
  * turn to follow the line at the given position.
  *
  * @param line_position The position of the line in a range of [-100, +100]
@@ -98,6 +98,7 @@
   * Turn on, off or toggle a specific LED
   * @param i the LED number LED_0 .. LED_7
   * @param state the LED state LED_ON, LED_OFF, LED_TOGGLE 
+  * @example led(LED_0, LED_ON); turns LED 0 on.
   */
 void led(LedIndex i, LedState state);