Basic RGB library for non-PWM LEDs

Dependents:   MenuExample exosite_http_example exosite_http_example FastPWM

Warning : Works with non-PWM LED (0 or 1).

A quick example on how to use it.

#include "mbed.h"
#include "RGBLed.h"

RGBLed led(LED_RED, LED_GREEN, LED_BLUE);

int main() {
    RGBLed::Color list[8] = {RGBLed::BLACK, RGBLed::RED, RGBLed::GREEN, RGBLed::BLUE, RGBLed::MAGENTA, RGBLed::CYAN, RGBLed::YELLOW, RGBLed::WHITE};
    int i = 0;

    while (true) {
        i = (i+1)%8;
        led.setColor(list[i]);
        wait_ms(100);
    }
}
Download repository: zip gz

Files at revision 6:9b7ee7ba4109

Name Size Actions
[up]
RGBLed.cpp 1965 Revisions Annotate
RGBLed.h 3289 Revisions Annotate