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

Files at this revision

API Documentation at this revision

Comitter:
pcordemans
Date:
Tue Feb 24 09:06:29 2015 +0000
Parent:
3:b5d18690f357
Child:
5:355240d7126b
Commit message:
removed racing_robots.h

Changed in this revision

racing_robots.cpp Show annotated file Show diff for this revision Revisions of this file
racing_robots.h Show diff for this revision Revisions of this file
robot_logic.h Show annotated file Show diff for this revision Revisions of this file
--- a/racing_robots.cpp	Tue Feb 24 09:01:06 2015 +0000
+++ b/racing_robots.cpp	Tue Feb 24 09:06:29 2015 +0000
@@ -1,4 +1,4 @@
-#include "racing_robots.h"
+#include "robot_logic.h"
 
 // External functions called from our library
 extern void init(void);
--- a/racing_robots.h	Tue Feb 24 09:01:06 2015 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-#include "mbed.h"
-#include "m3pi.h"
-#include "robot_logic.h"
-
-#ifndef H_RACING_ROBOTS
-#define H_RACING_ROBOTS
-
-#endif
\ No newline at end of file
--- a/robot_logic.h	Tue Feb 24 09:01:06 2015 +0000
+++ b/robot_logic.h	Tue Feb 24 09:06:29 2015 +0000
@@ -1,9 +1,9 @@
+#ifndef H_ROBOT_LOGIC
+#define H_ROBOT_LOGIC
+
 #include "mbed.h"
 #include "m3pi.h"
 
-#ifndef H_ROBOT_LOGIC
-#define H_ROBOT_LOGIC
-
 typedef enum {
    LED_1 = 0,
    LED_2 = 1,