Giles Barton-Owen / Mbed 2 deprecated Flasher_HelloWorld

Dependencies:   mbed Flasher

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001  // Switches LED1 through the different modes
00002  #include "mbed.h"
00003  #include "Flasher.h"
00004  
00005  Flasher myFlasher(LED1, OFF); //Defines myFlasher on LED1 starting off
00006  
00007  int main() {
00008       while(1){   
00009           wait(5);
00010           myFlasher.updateFlash(ON);
00011           wait(5);
00012           myFlasher.updateFlash(SLOW);
00013           wait(5);
00014           myFlasher.updateFlash(MEDIUM);
00015           wait(5);
00016           myFlasher.updateFlash(QUICK);
00017           wait(5);
00018           myFlasher.onFor(3,ON,MEDIUM);
00019           wait(5);
00020           myFlasher.pauseFor(2);
00021           wait(5);
00022           myFlasher.updateFlash(OFF);
00023       }
00024   }