Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
led.cpp
- Committer:
- diana_s
- Date:
- 2017-11-18
- Revision:
- 0:3cabc617d433
- Child:
- 1:55b5e6d28fb3
File content as of revision 0:3cabc617d433:
#include "LED.h"
#include "mbed.h"
 LED::LED(PinName pin): LEDpin(pin) {
    LEDpin=0;
}
    
void LED::ledOn(){
    LEDpin = 1;
}
void LED::ledOff(){
    LEDpin = 0;
}
void LED::toggle(){
    LEDpin = !LEDpin;
}
void LED::blink(float duration) {
    this->toggle();
    wait(duration);
    this->toggle();
}