satbir panesar / Mbed 2 deprecated elec350

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Led.cpp Source File

Led.cpp

00001 #include "Led.h"
00002 
00003 Led::Led(PinName pinName):
00004 pin(pinName)
00005 {
00006 }
00007 void Led::switchOn(){
00008     this->pin = 1;
00009     }
00010 void Led::switchOff(){
00011     this->pin = 0;
00012     }
00013 void Led::flash(float time){
00014     this->pin = 1;
00015     wait(time);
00016     this->pin = 0;
00017     }