1st mbed library built - mbed Flasher
Flasher.cpp@0:446c73b5555a, 2011-07-13 (annotated)
- Committer:
- tothbuiaelliott
- Date:
- Wed Jul 13 13:59:05 2011 +0000
- Revision:
- 0:446c73b5555a
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tothbuiaelliott | 0:446c73b5555a | 1 | #include "Flasher.h" |
tothbuiaelliott | 0:446c73b5555a | 2 | #include "mbed.h" |
tothbuiaelliott | 0:446c73b5555a | 3 | |
tothbuiaelliott | 0:446c73b5555a | 4 | Flasher::Flasher(PinName pin) : _pin(pin) { |
tothbuiaelliott | 0:446c73b5555a | 5 | _pin = 0; |
tothbuiaelliott | 0:446c73b5555a | 6 | } |
tothbuiaelliott | 0:446c73b5555a | 7 | |
tothbuiaelliott | 0:446c73b5555a | 8 | void Flasher::flash(int n) { |
tothbuiaelliott | 0:446c73b5555a | 9 | for(int i = 0; i < n*2; n++) { |
tothbuiaelliott | 0:446c73b5555a | 10 | _pin = !_pin; |
tothbuiaelliott | 0:446c73b5555a | 11 | wait(0.2); |
tothbuiaelliott | 0:446c73b5555a | 12 | } |
tothbuiaelliott | 0:446c73b5555a | 13 | |
tothbuiaelliott | 0:446c73b5555a | 14 | } |
tothbuiaelliott | 0:446c73b5555a | 15 |