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

Committer:
sillevl
Date:
Wed Jan 20 17:54:16 2016 +0000
Revision:
12:4cb092df6958
Parent:
10:4200a8140b10
update library to forked project

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sillevl 0:9f02ae958e20 1 #pragma once
sillevl 0:9f02ae958e20 2
sillevl 0:9f02ae958e20 3 #include "mbed.h"
sillevl 0:9f02ae958e20 4 #include "TLC59116.h"
sillevl 0:9f02ae958e20 5 #include "Color.h"
sillevl 0:9f02ae958e20 6
sillevl 0:9f02ae958e20 7 enum DistanceSensor{
sillevl 0:9f02ae958e20 8 FRONT_LEFT,
sillevl 0:9f02ae958e20 9 FRONT_MIDDLE_LEFT,
sillevl 0:9f02ae958e20 10 BACK_MIDDLE_LEFT,
sillevl 0:9f02ae958e20 11 BACK_LEFT,
sillevl 0:9f02ae958e20 12 BACK_RIGHT,
sillevl 0:9f02ae958e20 13 BACK_MIDDLE_RIGHT,
sillevl 0:9f02ae958e20 14 FRONT_MIDDLE_RIGHT,
sillevl 0:9f02ae958e20 15 FRONT_RIGHT
sillevl 0:9f02ae958e20 16 };
sillevl 0:9f02ae958e20 17
sillevl 0:9f02ae958e20 18 class LedRing{
sillevl 0:9f02ae958e20 19 public:
sillevl 10:4200a8140b10 20 LedRing(I2C &i2c);
sillevl 0:9f02ae958e20 21 LedRing(PinName sda, PinName scl);
sillevl 0:9f02ae958e20 22
sillevl 0:9f02ae958e20 23 void setColor(int led, Color* Color);
sillevl 0:9f02ae958e20 24 void setColor(int led, int color);
sillevl 0:9f02ae958e20 25 void setAll(int color);
sillevl 0:9f02ae958e20 26 void setAll(Color* color);
sillevl 0:9f02ae958e20 27 void setAll(int* colors);
sillevl 0:9f02ae958e20 28 void setBrightness(float brightness);
sillevl 0:9f02ae958e20 29
sillevl 0:9f02ae958e20 30 void greenRedGradient(int led, int value);
sillevl 0:9f02ae958e20 31
sillevl 0:9f02ae958e20 32 protected:
sillevl 10:4200a8140b10 33 void initialize();
sillevl 0:9f02ae958e20 34 void setLed(TLC59116* driver, int startChannel, Color* color);
sillevl 0:9f02ae958e20 35
sillevl 0:9f02ae958e20 36 private:
sillevl 0:9f02ae958e20 37 TLC59116 driver1;
sillevl 0:9f02ae958e20 38 TLC59116 driver2;
sillevl 0:9f02ae958e20 39
sillevl 0:9f02ae958e20 40 static const int DRIVER_1_ADDRESS = 0xC0;
sillevl 0:9f02ae958e20 41 static const int DRIVER_2_ADDRESS = 0xC2;
sillevl 0:9f02ae958e20 42
sillevl 0:9f02ae958e20 43 };