Simple library for LED blinking.
Fork of Blinker by
Blinker.h
- Committer:
- tbjazic
- Date:
- 2015-11-15
- Revision:
- 2:190915d53c0b
- Parent:
- 1:ea5bb72717cc
File content as of revision 2:190915d53c0b:
#ifndef MBED_BLINKER_H_TB #define MBED_BLINKER_H_TB #include "mbed.h" /** 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 * * Example of use: * @code * #include "mbed.h" * #include "Blinker.h" * * int main() { * Blinker myBlinker(LED3); * myBlinker.blink(10); * wait(2); * myBlinker.blink(5, 1); * } * @endcode */ class Blinker { private: DigitalOut myled; public: /** Constructor receives a pin name that LED is connected to. */ Blinker(PinName pin); /** Function recevies number of blinks (flashes) and a time of duration of each blink. */ void blink(int n, float t = 0.5); }; #endif