yajuan yue / Mbed 2 deprecated ele350

Dependencies:   mbed

Fork of ele350 by JIAWEI ZHANG

Led.cpp

Committer:
GGHHHH
Date:
2015-10-15
Revision:
0:b43794060b94
Child:
6:f804bb3faa26

File content as of revision 0:b43794060b94:

#include "Led.h"        //includes the header with the class definition 

//constructor
Led::Led(string s)      //contructor implementation
{
    if(s== "red")
         pin= PD_14;    //The pin for the red led
         
    l = new DigitalOut(pin);
}

void Led::On()          //function implementation
{
     l->write(1);       //set the value of the pin to l
}

void Led::Off()
{
     l->write(0);       //set the value of the pin to 0
}