Exemple fait en classe th4 du cours 247-637 (2017)

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
YROY2004
Date:
Fri Sep 15 21:12:32 2017 +0000
Parent:
0:669a6bff2494
Commit message:
Version publique

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
piloteBaseDeTemps.cpp Show annotated file Show diff for this revision Revisions of this file
piloteBaseDeTemps.h Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Fri Sep 15 20:02:05 2017 +0000
+++ b/main.cpp	Fri Sep 15 21:12:32 2017 +0000
@@ -1,25 +1,22 @@
 #include "mbed.h"
 
+#include "piloteBaseDeTemps.h"
 #include "processusUART.h"
 #include "processusExemple.h"
 #include "processusBouton.h"
 
 
-
 void initialiseMain(void)
 {
+    initialisePiloteBaseDeTemps();
     initialiseUART();
     initialiseBouton();
     initialiseExemple();
-    }
+}
 
 
 int main()
 {
     while(1) {
-        wait(1);
-        gereBouton();
-        gereExemple();
-        gereUART();
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piloteBaseDeTemps.cpp	Fri Sep 15 21:12:32 2017 +0000
@@ -0,0 +1,21 @@
+#include "mbed.h"
+#include "piloteBaseDeTemps.h"
+#include "processusBouton.h"
+#include "processusExemple.h"
+#include "processusUART.h"
+
+Ticker piloteBaseDeTemps;
+
+void gerePiloteBaseDeTemps(void);
+
+void initialisePiloteBaseDeTemps(void)
+{
+    piloteBaseDeTemps.attach(&gerePiloteBaseDeTemps, 0.1); 
+}
+
+void gerePiloteBaseDeTemps(void)
+{
+        gereBouton();
+        gereExemple();
+        gereUART();
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/piloteBaseDeTemps.h	Fri Sep 15 21:12:32 2017 +0000
@@ -0,0 +1,6 @@
+#ifndef PROCESSUS_PILOTE_BASE_DE_TEMPS_H
+#define PROCESSUS_PILOTE_BASE_DE_TEMPS_H
+
+void initialisePiloteBaseDeTemps(void);
+
+#endif
\ No newline at end of file