![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
this is the library of the code of the second laboration.
Dependencies: SILABS_RHT mbed MemoryLCD
Diff: lb123.h
- Revision:
- 0:33ae04d01fd6
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lb123.h Fri Sep 04 11:39:49 2020 +0000 @@ -0,0 +1,66 @@ +#ifndef MAIN_H +#define MAIN_H +#include "mbed.h" +/** led class. + A collection of functions created for lab 2 in the course ET095G +* Mahmood Rahimi och Alia Jabar. + + To use this library, its header file needs to be included and an object of the led class created.. +* +* Example: +* @code +* #include "mbed.h" +* #include "lb123.h" +* +* my led; +* +* int main() { +* @endcode +*/ +class led +{ +public: + /** The constructor creates an instance of the led class. It is automatically called when a new object is declared. + */ + led(); + + /** Det är funktion för slå på led0. + */ + void led::on_led0(); + + /** det är funktion för slå på led1. + */ + void led::on_led1(); + + /** Det är funktion för slå off led0. + */ + void led::off_led0(); + + /** Det är funktion för slå off led1. + */ + void led::off_led1(); + + /** This function inverts the state of led0, so off becomes on and on becomes off. + */ + void led::toggle_led0(); + + /** This function inverts the state of led1, so off becomes on and on becomes off. + */ + void led::toggle_led1(); + + /** This function blinks led0 once. + */ + void led::blink_led0(); + + /** This function blinks led1 once. + */ + void led::blink_led1(); + + +private: + DigitalOut led0; + DigitalOut led1; + +}; + +#endif \ No newline at end of file