asha pawar
/
HelloWorld
my own library
Fork of HelloWorld by
Flasher.cpp@2:d42b0e3fe08a, 2015-11-25 (annotated)
- Committer:
- ashapawar
- Date:
- Wed Nov 25 09:46:48 2015 +0000
- Revision:
- 2:d42b0e3fe08a
files
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ashapawar | 2:d42b0e3fe08a | 1 | #include "Flasher.h" |
ashapawar | 2:d42b0e3fe08a | 2 | #include "mbed.h" |
ashapawar | 2:d42b0e3fe08a | 3 | |
ashapawar | 2:d42b0e3fe08a | 4 | Flasher::Flasher(PinName pin) : _pin(pin) { |
ashapawar | 2:d42b0e3fe08a | 5 | _pin = 0; |
ashapawar | 2:d42b0e3fe08a | 6 | } |
ashapawar | 2:d42b0e3fe08a | 7 | |
ashapawar | 2:d42b0e3fe08a | 8 | void Flasher::flash(int n) { |
ashapawar | 2:d42b0e3fe08a | 9 | for(int i=0; i<n*2; i++) { |
ashapawar | 2:d42b0e3fe08a | 10 | _pin = !_pin; |
ashapawar | 2:d42b0e3fe08a | 11 | wait(0.2); |
ashapawar | 2:d42b0e3fe08a | 12 | } |
ashapawar | 2:d42b0e3fe08a | 13 | } |