library for 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:   m3pi ADXL345_I2C HMC5583L ITG3200 PCA9547 TLC59116 VL6180x RGB-fun xbee

Dependents:   m3Dpi-helloworld

Revision:
0:9f02ae958e20
Child:
4:b2fe3a2545bf
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/M3Dpi.h	Thu Dec 03 07:58:50 2015 +0000
@@ -0,0 +1,57 @@
+#pragma once
+
+#include "m3pi.h"
+
+#include "StatusLed.h"
+#include "Color.h"
+#include "LedRing.h"
+#include "hmc5583l.h"
+#include "ITG3200.h"
+#include "ADXL345_I2C.h"
+#include "PCA9547.h"
+//#include "vl6108x.h"
+#include "vl6180xManager.h"
+#include "xbee.h"
+
+class M3Dpi : public m3pi{
+        
+    public:
+    M3Dpi();
+    
+    void setStatus(int color);
+    void setStatus(Color* color);
+    
+    void setLeds(int* colors);
+    int* getDistance(int data[]);
+    int* getDirection(int data[]); // compass
+    int* getRotation(int data[]); // gyro
+    int* getAcceleration(int data[]);
+    char* getTime(char buffer[]);
+    
+    // buttonhandler (interrupt based?)
+        
+    //protected:    // public for hardware testing only
+    StatusLed status;
+    LedRing leds;
+    
+    HMC5583L compass;
+    ITG3200 gyro;
+    ADXL345_I2C accelerometer;
+    VL6180xManager distance;
+    Xbee xbee;
+    
+    static const PinName SDA = p28;
+    static const PinName SCL = p27;
+    static const PinName XBEE_TX = p13;
+    static const PinName XBEE_RX = p14;
+    static const PinName XBEE_RESET = p12;
+    static const PinName STATUS_RED = p18;
+    static const PinName STATUS_GREEN = p19;
+    static const PinName STATUS_BLUE = p20;
+    
+    static const int XBEE_BAUD = 115200;
+
+    virtual int _putc(int c);
+    virtual int _getc();
+    
+};
\ No newline at end of file