![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Library A: LED library to controll the led on the Happy Gecko.
Diff: LED.h
- Revision:
- 0:3cabc617d433
- Child:
- 1:55b5e6d28fb3
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LED.h Sat Nov 18 17:03:48 2017 +0000 @@ -0,0 +1,37 @@ +#ifndef MBED_LED_H +#define MBED_LED_H + +#include "mbed.h" + + +/** LED class. + * To use the library, its header file needs to be included and an object of the LED class created. + + * @endcode + */ + + +class LED { +public: + /** The constructor creates an instance of the LED class. It is automatically called when a new object is declared. + */ + LED(PinName pin); + /** This function turns led on. + */ + void ledOn(); + /** This function turns led off. + */ + void ledOff(); + /** This function inverts the value of the led. + */ + void toggle(); + /** This function makes the led blink on a specific duration. + */ + void blink(float duration); + +private: + DigitalOut LEDpin; +}; + +#endif + \ No newline at end of file