Basic Led Library
Diff: LED.cpp
- Revision:
- 0:ccc1d1ad706f
diff -r 000000000000 -r ccc1d1ad706f LED.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LED.cpp Sat Feb 18 04:11:45 2017 +0000 @@ -0,0 +1,24 @@ +#include "mbed.h" +#include "LED.h" + +Led::Led(PinName pin):_pin(pin){ + _pin = 0; + state = false; +} + +void Led::On(){ + _pin = 1; + state = true; +} +void Led::Off(){ + _pin = 0; + state = false; +} + +void Led::Toggle(){ + if(state){ + Led::Off(); + }else{ + Led::On(); + } +} \ No newline at end of file