my generic framework

Dependents:   generic_framework_test

Files at this revision

API Documentation at this revision

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
--- 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
--- 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;
+}