AirsoftTimer software based on mbed
Dependencies: mbed TextLCD keypad
Diff: board/Leds.cpp
- Revision:
- 11:50572814f73e
- Parent:
- 4:2c91c9eccf3a
--- a/board/Leds.cpp Sun Dec 14 11:50:19 2014 +0000 +++ b/board/Leds.cpp Wed Dec 31 15:27:43 2014 +0000 @@ -1,6 +1,36 @@ #include "Leds.h" -Leds::Leds(PinName leftPin, PinName rightPin){ - +Leds::Leds(PinName leftPin, PinName rightPin) : leftLed(leftPin), rightLed(rightPin){ + off(ALL); +} + +void Leds::on(Leds::LedName ledname){ + switch(ledname){ + case LEFT: + leftLed.write(1); + break; + case RIGHT: + rightLed.write(1); + break; + case ALL: + leftLed.write(1); + rightLed.write(1); + //break: + } +} + +void Leds::off(Leds::LedName ledname){ + switch(ledname){ + case LEFT: + leftLed.write(0); + break; + case RIGHT: + rightLed.write(0); + break; + case ALL: + leftLed.write(0); + rightLed.write(0); + //break: + } } \ No newline at end of file