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

lib/StatusLed.cpp

Committer:
sillevl
Date:
2015-12-03
Revision:
0:9f02ae958e20
Child:
5:a75574090b59

File content as of revision 0:9f02ae958e20:


#include "StatusLed.h"

StatusLed::StatusLed(PinName r_pin, PinName g_pin, PinName b_pin) : r_out(r_pin), g_out(g_pin), b_out(b_pin)
{

}

void StatusLed::setColor(Color* color){
    r_out = !color->getRed();
    g_out = !color->getGreen();
    b_out = !color->getBlue();
}

void StatusLed::setColor(int color){
    setColor(new Color(color));
}

void StatusLed::off(){
    setColor(Color::BLACK);   
}