ok blink
Diff: blink.cpp
- Revision:
- 0:994d48d4baab
- Child:
- 1:f91a78f50aa5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/blink.cpp Tue Nov 02 23:53:19 2010 +0000 @@ -0,0 +1,13 @@ +#include "blink.h" +#include "mbed.h" + +BLINK::BLINK(PinName pin) : _pin(pin) { // _pin(pin) means pass pin to the DigitalOut constructor + _pin = LED2; // default the output to LED2 +} + +void BLINK::flash(int n) { + for (int i=0; i<n*2; i++) { + _pin = !_pin; + wait(0.2); + } +}