ok blink

blink.cpp

Committer:
nielsen8
Date:
2010-11-03
Revision:
1:f91a78f50aa5
Parent:
0:994d48d4baab

File content as of revision 1:f91a78f50aa5:

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

void BLINK::on(void)
{
    _pin = 1;
}
void BLINK::off(void)
{
    _pin = 0;
}