Hello world RGB app

Dependencies:   RGB-Led mbed

RGB Led Driver example

This is an example program on how to initiate the RGB Led Driver functions.

Main file

Repository: hello_world_RGB

RGB Led Driver

Import libraryRGB-Led

RGB-Led driver, used to handle convertions between HEX and integer to regulate LEDS through the embed.

Committer:
ciryk
Date:
Thu Dec 10 14:51:15 2015 +0000
Revision:
0:239dd038cb8b
Main added

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ciryk 0:239dd038cb8b 1 #include "mbed.h"
ciryk 0:239dd038cb8b 2 /** My HelloWorld class.
ciryk 0:239dd038cb8b 3 * Used for printing "Hello World" on USB serial.
ciryk 0:239dd038cb8b 4 */
ciryk 0:239dd038cb8b 5 DigitalOut myled(LED1);
ciryk 0:239dd038cb8b 6
ciryk 0:239dd038cb8b 7 int main() {
ciryk 0:239dd038cb8b 8 while(1) {
ciryk 0:239dd038cb8b 9 Color* chosen = new Color(Color::RED);
ciryk 0:239dd038cb8b 10
ciryk 0:239dd038cb8b 11 Color* rood = new Color(Color::RED);
ciryk 0:239dd038cb8b 12 Color* groen = new Color(Color::GREEN);
ciryk 0:239dd038cb8b 13 Color* blauw = new Color(Color::BLUE);
ciryk 0:239dd038cb8b 14 Color* white = new Color(Color::WHITE);
ciryk 0:239dd038cb8b 15 /*Color* rood = new Color(Color::RED);
ciryk 0:239dd038cb8b 16 Color* rood3 = new Color(216711680);*/
ciryk 0:239dd038cb8b 17
ciryk 0:239dd038cb8b 18 RGB* myLed = new RGB(p23,p24,p25);
ciryk 0:239dd038cb8b 19
ciryk 0:239dd038cb8b 20
ciryk 0:239dd038cb8b 21 myLed->setColor(chosen);
ciryk 0:239dd038cb8b 22 wait(0.3);
ciryk 0:239dd038cb8b 23 myLed->setColor(white);
ciryk 0:239dd038cb8b 24 wait(0.3);
ciryk 0:239dd038cb8b 25 }
ciryk 0:239dd038cb8b 26 }
ciryk 0:239dd038cb8b 27
ciryk 0:239dd038cb8b 28