Making things flash in all colours

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 DigitalOut redLED(LED1);
00004 DigitalOut greenLED(LED2);
00005 DigitalOut blueLED(LED3);
00006 
00007 int main() {
00008     redLED = 1;
00009     greenLED = 1;
00010     blueLED = 1;
00011     while(1) {
00012         redLED = 0;
00013         wait(2.0);
00014         redLED = 1;
00015         wait(0.2);
00016         
00017         greenLED = 0;
00018         wait(2.0);
00019         greenLED = 1;
00020         wait(0.2);
00021         
00022         blueLED = 0;
00023         wait(2.0);
00024         blueLED = 1;
00025         wait(0.2);
00026     }
00027 }