satbir panesar
/
elec350
my library for elec350
Diff: Led.cpp
- Revision:
- 1:8cd3ad6ab5f3
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Led.cpp Thu Oct 06 09:40:57 2016 +0000 @@ -0,0 +1,17 @@ +#include "Led.h" + +Led::Led(PinName pinName): +pin(pinName) +{ +} +void Led::switchOn(){ + this->pin = 1; + } +void Led::switchOff(){ + this->pin = 0; + } +void Led::flash(float time){ + this->pin = 1; + wait(time); + this->pin = 0; + }