ok blink

blink.cpp

Committer:
nielsen8
Date:
2010-11-02
Revision:
0:994d48d4baab
Child:
1:f91a78f50aa5

File content as of revision 0:994d48d4baab:

#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);
    }
}