Simple library for LED blinking.
Dependents: roam_v2 finalV1 finalV1 finalv2 ... more
Diff: Blinker.h
- Revision:
- 2:190915d53c0b
- Parent:
- 1:ea5bb72717cc
- Child:
- 3:286a364f952f
--- a/Blinker.h Tue Dec 16 09:25:44 2014 +0000 +++ b/Blinker.h Sun Nov 15 09:12:51 2015 +0000 @@ -3,7 +3,10 @@ #include "mbed.h" -/** Simple class for learning development of libraries. +/** Simple class for learning development of libraries. The main task + * is to blink (flash) a LED connected to a specified pin N times. + * Each blink should last 0.5 seconds by default, or some other time + * that user can set. * * Author: TVZ Mechatronics Team * @@ -13,10 +16,10 @@ * #include "Blinker.h" * * int main() { - * Blinker mojBlinker(LED3); - * mojBlinker.blink(10); + * Blinker myBlinker(LED3); + * myBlinker.blink(10); * wait(2); - * mojBlinker.blink(5, 0.5); + * myBlinker.blink(5, 1); * } * @endcode */ @@ -24,8 +27,10 @@ private: DigitalOut myled; public: + /** Constructor receives a pin name that LED is connected to. */ Blinker(PinName pin); - void blink(int n, float t = 0.2); + /** Function recevies number of blinks (flashes) and a time of duration of each blink. */ + void blink(int n, float t = 0.5); }; #endif \ No newline at end of file