AirsoftTimer software based on mbed

Dependencies:   mbed TextLCD keypad

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Leds.cpp Source File

Leds.cpp

00001 #include "Leds.h"
00002 
00003 
00004 Leds::Leds(PinName leftPin, PinName rightPin) : leftLed(leftPin), rightLed(rightPin){
00005     off(ALL);
00006 }
00007 
00008 void Leds::on(Leds::LedName ledname){
00009     switch(ledname){
00010         case LEFT:
00011             leftLed.write(1);
00012             break;
00013         case RIGHT:
00014             rightLed.write(1);
00015             break;
00016         case ALL:
00017             leftLed.write(1);
00018             rightLed.write(1);
00019             //break:
00020     }
00021 }
00022 
00023 void Leds::off(Leds::LedName ledname){
00024     switch(ledname){
00025         case LEFT:
00026             leftLed.write(0);
00027             break;
00028         case RIGHT:
00029             rightLed.write(0);
00030             break;
00031         case ALL:
00032             leftLed.write(0);
00033             rightLed.write(0);
00034             //break:
00035     }
00036 }