56
Revision 0:8115d66378d1, committed 2016-12-15
- Comitter:
- Paaranoja
- Date:
- Thu Dec 15 13:26:59 2016 +0000
- Commit message:
- 3
Changed in this revision
Blinker.cpp | Show annotated file Show diff for this revision Revisions of this file |
Blinker.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 8115d66378d1 Blinker.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Blinker.cpp Thu Dec 15 13:26:59 2016 +0000 @@ -0,0 +1,15 @@ +#include "mbed.h" +#include "Blinker.h" + +Blinker::Blinker(PinName pin):led(pin){ + led = 0; + } + + void Blinker::blink(int n, float p){ + for (int i = 0; i < n; i++){ + led = 1; + wait(p/2); + led = 0; + wait(p/2); + } + } \ No newline at end of file
diff -r 000000000000 -r 8115d66378d1 Blinker.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Blinker.h Thu Dec 15 13:26:59 2016 +0000 @@ -0,0 +1,9 @@ +#include "mbed.h" + +class Blinker { + public: + Blinker(PinName pin); + void blink(int, float); + private: + DigitalOut led; + }; \ No newline at end of file