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 "m3pi.h"
sillevl 0:9f02ae958e20 4
sillevl 0:9f02ae958e20 5 #include "StatusLed.h"
sillevl 0:9f02ae958e20 6 #include "Color.h"
sillevl 0:9f02ae958e20 7 #include "LedRing.h"
sillevl 0:9f02ae958e20 8 #include "hmc5583l.h"
sillevl 0:9f02ae958e20 9 #include "ITG3200.h"
sillevl 0:9f02ae958e20 10 #include "ADXL345_I2C.h"
sillevl 0:9f02ae958e20 11 #include "PCA9547.h"
sillevl 0:9f02ae958e20 12 //#include "vl6108x.h"
sillevl 0:9f02ae958e20 13 #include "vl6180xManager.h"
sillevl 0:9f02ae958e20 14 #include "xbee.h"
sillevl 4:b2fe3a2545bf 15 #include "datatypes.h"
sillevl 0:9f02ae958e20 16
sillevl 4:b2fe3a2545bf 17 class M3Dpi : public m3pi
sillevl 4:b2fe3a2545bf 18 {
sillevl 4:b2fe3a2545bf 19
sillevl 4:b2fe3a2545bf 20 public:
sillevl 0:9f02ae958e20 21 M3Dpi();
sillevl 4:b2fe3a2545bf 22
sillevl 0:9f02ae958e20 23 void setStatus(int color);
sillevl 0:9f02ae958e20 24 void setStatus(Color* color);
sillevl 4:b2fe3a2545bf 25
sillevl 0:9f02ae958e20 26 void setLeds(int* colors);
sillevl 4:b2fe3a2545bf 27 m3dpi::Distance getDistance();
sillevl 4:b2fe3a2545bf 28 m3dpi::Direction getDirection(); // compass
sillevl 4:b2fe3a2545bf 29 m3dpi::Rotation getRotation(); // gyro
sillevl 4:b2fe3a2545bf 30 m3dpi::Acceleration getAcceleration();
sillevl 4:b2fe3a2545bf 31 time_t getTime();
sillevl 4:b2fe3a2545bf 32
sillevl 0:9f02ae958e20 33 // buttonhandler (interrupt based?)
sillevl 4:b2fe3a2545bf 34
sillevl 0:9f02ae958e20 35 //protected: // public for hardware testing only
sillevl 10:4200a8140b10 36
sillevl 10:4200a8140b10 37 I2C i2c;
sillevl 10:4200a8140b10 38
sillevl 0:9f02ae958e20 39 StatusLed status;
sillevl 0:9f02ae958e20 40 LedRing leds;
sillevl 4:b2fe3a2545bf 41
sillevl 0:9f02ae958e20 42 HMC5583L compass;
sillevl 0:9f02ae958e20 43 ITG3200 gyro;
sillevl 0:9f02ae958e20 44 ADXL345_I2C accelerometer;
sillevl 0:9f02ae958e20 45 VL6180xManager distance;
sillevl 0:9f02ae958e20 46 Xbee xbee;
sillevl 4:b2fe3a2545bf 47
sillevl 0:9f02ae958e20 48 static const PinName SDA = p28;
sillevl 0:9f02ae958e20 49 static const PinName SCL = p27;
sillevl 0:9f02ae958e20 50 static const PinName XBEE_TX = p13;
sillevl 0:9f02ae958e20 51 static const PinName XBEE_RX = p14;
sillevl 0:9f02ae958e20 52 static const PinName XBEE_RESET = p12;
sillevl 0:9f02ae958e20 53 static const PinName STATUS_RED = p18;
sillevl 0:9f02ae958e20 54 static const PinName STATUS_GREEN = p19;
sillevl 0:9f02ae958e20 55 static const PinName STATUS_BLUE = p20;
sillevl 4:b2fe3a2545bf 56
kudrom 8:c5655efda2a0 57 static const int XBEE_BAUD = 57600;
sillevl 0:9f02ae958e20 58
sillevl 0:9f02ae958e20 59 virtual int _putc(int c);
sillevl 0:9f02ae958e20 60 virtual int _getc();
sillevl 4:b2fe3a2545bf 61
sillevl 0:9f02ae958e20 62 };