Sille Van Landschoot / Mbed 2 deprecated rgb-fun-helloworld

Dependencies:   RGB-fun mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "RGB.h"
00003 
00004 RGB led(p23,p24,p25);
00005 
00006 int main()
00007 {
00008     led.off();
00009 
00010     wait(1.0);
00011 
00012     // setting the color using the Color enum with named colors
00013     led.setColor(Color::RED);
00014 
00015     // setting the color using a hexadecimal notated integer (yellow)
00016     led.setColor(0xFFFF00);
00017 
00018     // setting the color using an instance of the Color class
00019     Color* myColor = new Color(0,255,0);
00020     led.setColor(myColor);
00021     delete myColor;
00022 }