Example program for the Seeed Studio Grove RGB Chainable LED's.

Dependencies:   Chainable_RGB_LED mbed

Fork of be_colorful by Yihui Xiong

main.cpp

Committer:
yihui
Date:
2013-10-15
Revision:
0:71564ae5e242
Child:
1:10700868060f

File content as of revision 0:71564ae5e242:

#include "mbed.h"
#include "ChainableLED.h"

DigitalOut led(LED4);
// ChainableLED(clk, data, number_of_leds)
ChainableLED color_led(P1_14, P1_13, 1);

int main() {
    uint8_t value = 0;
    
    while(1) {
        value += 10;
        // ChainableLED.setColorRGB(index_of_led, red, green, blue)
        color_led.setColorRGB(0, value, 0xFF - value, 0);
        led = !led;
        wait(0.4);
    }
}