Giles Barton-Owen
/
Flasher_HelloWorld
A small program demonstrating use of the Flasher class
main.cpp@0:cc4359728915, 2011-02-19 (annotated)
- Committer:
- p07gbar
- Date:
- Sat Feb 19 14:37:29 2011 +0000
- Revision:
- 0:cc4359728915
V1.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
p07gbar | 0:cc4359728915 | 1 | // Switches LED1 through the different modes |
p07gbar | 0:cc4359728915 | 2 | #include "mbed.h" |
p07gbar | 0:cc4359728915 | 3 | #include "Flasher.h" |
p07gbar | 0:cc4359728915 | 4 | |
p07gbar | 0:cc4359728915 | 5 | Flasher myFlasher(LED1, OFF); //Defines myFlasher on LED1 starting off |
p07gbar | 0:cc4359728915 | 6 | |
p07gbar | 0:cc4359728915 | 7 | int main() { |
p07gbar | 0:cc4359728915 | 8 | while(1){ |
p07gbar | 0:cc4359728915 | 9 | wait(5); |
p07gbar | 0:cc4359728915 | 10 | myFlasher.updateFlash(ON); |
p07gbar | 0:cc4359728915 | 11 | wait(5); |
p07gbar | 0:cc4359728915 | 12 | myFlasher.updateFlash(SLOW); |
p07gbar | 0:cc4359728915 | 13 | wait(5); |
p07gbar | 0:cc4359728915 | 14 | myFlasher.updateFlash(MEDIUM); |
p07gbar | 0:cc4359728915 | 15 | wait(5); |
p07gbar | 0:cc4359728915 | 16 | myFlasher.updateFlash(QUICK); |
p07gbar | 0:cc4359728915 | 17 | wait(5); |
p07gbar | 0:cc4359728915 | 18 | myFlasher.onFor(3,ON,MEDIUM); |
p07gbar | 0:cc4359728915 | 19 | wait(5); |
p07gbar | 0:cc4359728915 | 20 | myFlasher.pauseFor(2); |
p07gbar | 0:cc4359728915 | 21 | wait(5); |
p07gbar | 0:cc4359728915 | 22 | myFlasher.updateFlash(OFF); |
p07gbar | 0:cc4359728915 | 23 | } |
p07gbar | 0:cc4359728915 | 24 | } |