Hello world example project for RGB-fun library

Dependencies:   RGB-fun mbed

main.cpp

Committer:
sillevl
Date:
2015-12-10
Revision:
0:fe719ffe59b7

File content as of revision 0:fe719ffe59b7:

#include "mbed.h"
#include "RGB.h"

RGB led(p23,p24,p25);

int main()
{
    led.off();

    wait(1.0);

    // setting the color using the Color enum with named colors
    led.setColor(Color::RED);

    // setting the color using a hexadecimal notated integer (yellow)
    led.setColor(0xFFFF00);

    // setting the color using an instance of the Color class
    Color* myColor = new Color(0,255,0);
    led.setColor(myColor);
    delete myColor;
}