Hello world example project for RGB-fun library

Dependencies:   RGB-fun mbed

Committer:
sillevl
Date:
Thu Dec 10 09:58:33 2015 +0000
Revision:
0:fe719ffe59b7
hello world example for rgb fun library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sillevl 0:fe719ffe59b7 1 #include "mbed.h"
sillevl 0:fe719ffe59b7 2 #include "RGB.h"
sillevl 0:fe719ffe59b7 3
sillevl 0:fe719ffe59b7 4 RGB led(p23,p24,p25);
sillevl 0:fe719ffe59b7 5
sillevl 0:fe719ffe59b7 6 int main()
sillevl 0:fe719ffe59b7 7 {
sillevl 0:fe719ffe59b7 8 led.off();
sillevl 0:fe719ffe59b7 9
sillevl 0:fe719ffe59b7 10 wait(1.0);
sillevl 0:fe719ffe59b7 11
sillevl 0:fe719ffe59b7 12 // setting the color using the Color enum with named colors
sillevl 0:fe719ffe59b7 13 led.setColor(Color::RED);
sillevl 0:fe719ffe59b7 14
sillevl 0:fe719ffe59b7 15 // setting the color using a hexadecimal notated integer (yellow)
sillevl 0:fe719ffe59b7 16 led.setColor(0xFFFF00);
sillevl 0:fe719ffe59b7 17
sillevl 0:fe719ffe59b7 18 // setting the color using an instance of the Color class
sillevl 0:fe719ffe59b7 19 Color* myColor = new Color(0,255,0);
sillevl 0:fe719ffe59b7 20 led.setColor(myColor);
sillevl 0:fe719ffe59b7 21 delete myColor;
sillevl 0:fe719ffe59b7 22 }