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

Files at this revision

API Documentation at this revision

Comitter:
sillevl
Date:
Mon Dec 07 09:30:37 2015 +0000
Parent:
5:a75574090b59
Commit message:
add method to set the color of a single led

Changed in this revision

M3Dpi.cpp Show annotated file Show diff for this revision Revisions of this file
M3Dpi.h Show annotated file Show diff for this revision Revisions of this file
--- a/M3Dpi.cpp	Fri Dec 04 14:31:53 2015 +0000
+++ b/M3Dpi.cpp	Mon Dec 07 09:30:37 2015 +0000
@@ -45,6 +45,11 @@
     leds.setAll(colors);
 }
 
+void M3Dpi::setLed(int index, int color)
+{
+    leds.setColor(index, color);
+}
+
 m3dpi::Distance M3Dpi::getDistance()
 {
     return distance.getAllDistance();
--- a/M3Dpi.h	Fri Dec 04 14:31:53 2015 +0000
+++ b/M3Dpi.h	Mon Dec 07 09:30:37 2015 +0000
@@ -24,6 +24,7 @@
     void setStatus(Color* color);
 
     void setLeds(int* colors);
+    void setLed(int index, int color);
     m3dpi::Distance getDistance();
     m3dpi::Direction getDirection(); // compass
     m3dpi::Rotation getRotation(); // gyro