Revision 0:a293484a4f43, committed 2016-12-15
- Comitter:
- mcica
- Date:
- Thu Dec 15 12:21:18 2016 +0000
- Commit message:
- proba
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 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Blinker.cpp Thu Dec 15 12:21:18 2016 +0000 @@ -0,0 +1,14 @@ +#include "mbed.h" +#include "Blinker.h" + +Blinker::Blinker (PinName pin):led(pin) { + led=0; + } + void Blinker::blink(int n,float period){ + for (int i=0; i<n; i++){ + led1=1; + wait(period/2); + led=0; + wait(period/2); + } + } \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Blinker.h Thu Dec 15 12:21:18 2016 +0000 @@ -0,0 +1,10 @@ +#include "mbed.h" +include "Blinker.h" + +class Blinker { + public: + Blinker(PinName pin); + void blink(int,float); + private: + DigitalOut led; +} \ No newline at end of file