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/lib/vl6180xManager.h	Thu Dec 03 07:58:50 2015 +0000
@@ -0,0 +1,44 @@
+#pragma once
+
+#include "mbed.h"
+#include "PCA9547.h"
+#include "vl6180x.h"
+
+/*enum DistanceSensor{
+    FRONT,
+    FRONT_RIGHT,
+    RIGHT,
+    BACK_RIGHT,
+    BACK,
+    BACK_LEFT,
+    LEFT,
+    FRONT_LEFT
+}; */
+
+class VL6180xManager
+{
+public:
+    VL6180xManager(PinName sda, PinName scl);
+    void select(int index);
+    int* getAllDistance(int data[]);
+
+protected:
+
+/*    enum DistanceSensor {
+        FRONT,
+        FRONT_RIGHT,
+        RIGHT,
+        BACK_RIGHT,
+        BACK,
+        BACK_LEFT,
+        LEFT,
+        FRONT_LEFT
+    };*/
+    PCA9547 mux;
+    I2C i2c;
+    int address;
+    VL6180x sensor;
+
+    static const int SENSOR_COUNT = 8;
+    static const int VL6180X_ADDRESS = 0x52;
+};
\ No newline at end of file