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.
Fork of ele350 by
Led.cpp
- Committer:
- GGHHHH
- Date:
- 2015-11-19
- Revision:
- 14:5d3bd2e4ac91
- Parent:
- 7:f3c3cb6cea26
- Child:
- 15:8c0d195355d2
File content as of revision 14:5d3bd2e4ac91:
#include "led.h" //includes the header with the class definition
#include <vector>
//constructor
Led::Led(string name) //contructor implementation
{
if(name == "red"){
this->pinName = PD_14; //The pin for the red led
} else if(name == "green"){
this->pinName = PD_12;
} else if(name == "orange"){
this->pinName = PD_13;
} else if(name == "blue"){
this->pinName = PD_15;
}
void Led::On() {
this->pin->write(1);
this->isOn = true;
}
void Led::Off(){
this->pin->write(0);
this->isOn = false;
}
bool Led::getIsOn(){
return this->isOn;
}
