my generic framework
Dependents: generic_framework_test
Revision 1:c35046f358f6, committed 2019-05-01
- Comitter:
- AndersonIctus (anderson.ictus@gmail.com)
- Date:
- Wed May 01 15:53:24 2019 -0300
- Parent:
- 0:1e6019bda876
- Commit message:
- Teste de BLINK
Changed in this revision
headers/Teste.h | Show annotated file Show diff for this revision Revisions of this file |
sources/Teste.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 1e6019bda876 -r c35046f358f6 headers/Teste.h --- a/headers/Teste.h Thu Apr 25 22:44:43 2019 +0000 +++ b/headers/Teste.h Wed May 01 15:53:24 2019 -0300 @@ -1,9 +1,18 @@ +#ifndef GENERIC_TESTE +#define GENERIC_TESTE class Teste { public: + Teste(int blinks); + int sayHello(); - Teste(); + void rodaTeste(); + +private: + int _numBlinks; } -; \ No newline at end of file +; + +#endif
diff -r 1e6019bda876 -r c35046f358f6 sources/Teste.cpp --- a/sources/Teste.cpp Thu Apr 25 22:44:43 2019 +0000 +++ b/sources/Teste.cpp Wed May 01 15:53:24 2019 -0300 @@ -1,9 +1,26 @@ #include "mbed.h" #include "Teste.h" -Teste::Teste() { } +DigitalOut myled(LED1); + +Teste::Teste(int blinks) { + _numBlinks = blinks; + } int Teste::sayHello() { return 123; } + +void Teste::rodaTeste() +{ + int count = 0; + while(count++ < _numBlinks) { + myled = 1; + wait(0.3); + myled = 0; + wait(0.3); + } + + myled = 0; +}