
elec350
Fork of elec350 by
led.cpp
- Committer:
- rmerrisonhort
- Date:
- 2015-10-13
- Revision:
- 0:753cf4c2738f
- Child:
- 7:aa63d1e53be6
File content as of revision 0:753cf4c2738f:
#include "led.h" #include <vector> Led::Led(string name) { if (name == "red") { this->pinName = PD_14; } else if (name == "green") { this->pinName = PD_12; } else if (name == "orange") { this->pinName = PD_13; } else if (name == "blue") { this->pinName = PD_15; } this->pin = new DigitalOut(this->pinName); } void Led::SwitchOn() { this->pin->write(1); } void Led::SwitchOff() { this->pin->write(0); }