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:
8:597ce8a7d34b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xbee.h	Mon Jun 01 14:47:32 2015 +0000
@@ -0,0 +1,32 @@
+#ifndef XBEE_H
+#define XBEE_H
+
+#include "mbed.h"
+
+class Xbee{
+    
+    public:
+    Xbee(PinName tx, PinName rx);
+    int running();
+    int stopped();
+    void setCode(int code);
+    int hasCode();
+    
+    protected:
+    Serial* xbee;
+    void received();
+    
+    private:
+    int run;
+    int code;
+    
+    int buffer_pos;
+    char buffer[256];
+    
+    void reset();
+    DigitalOut* rst;
+    
+};
+
+
+#endif
\ No newline at end of file