schneider françois / Mbed OS BaseF411RE-v2

Dependencies:   C12832

Files at this revision

API Documentation at this revision

Comitter:
schnf30
Date:
Mon Nov 16 10:49:53 2020 +0000
Commit message:
Base

Changed in this revision

.gitignore Show annotated file Show diff for this revision Revisions of this file
C12832.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.gitignore	Mon Nov 16 10:49:53 2020 +0000
@@ -0,0 +1,4 @@
+.build
+.mbed
+projectfiles
+*.py*
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/C12832.lib	Mon Nov 16 10:49:53 2020 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/chris/code/C12832/#7de323fa46fe
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Nov 16 10:49:53 2020 +0000
@@ -0,0 +1,37 @@
+#include "mbed.h"
+#include "C12832.h"
+#include "platform/mbed_thread.h"
+
+// Rate acquisition
+#define BLINKING_RATE_MS  500
+C12832 lcd(D11, D13, D12, D7, D10);
+AnalogIn pot1 (A0);
+AnalogIn pot2 (A1);
+
+int main()
+{
+    float Entree1,Entree2;
+    while (true) {
+        // acqusition des entrees
+        Entree1 = 3.3*pot1.read();
+        Entree2 = 3.3*pot2.read();
+        // traitement de l entree1
+ 
+        lcd.cls();
+        lcd.locate(0,3);
+        if ( Entree1 < 0.36 ) {
+            lcd.printf("COURT CIRCUIT\n");
+        } else if ( Entree1 < 0.88 ) {
+            lcd.printf("ANOMALIE\n");
+        } else if ( Entree1 < 1.41 ) {
+            lcd.printf("PAS ANOMALIE\n");
+        } else {
+            lcd.printf("COUPE DE CABLE\n");
+        }
+
+        lcd.locate(0,14);
+        lcd.printf("Pot 2 = %.2f", Entree2);
+
+        thread_sleep_for(BLINKING_RATE_MS);   //wait....
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-os.lib	Mon Nov 16 10:49:53 2020 +0000
@@ -0,0 +1,1 @@
+https://github.com/ARMmbed/mbed-os/#cf4f12a123c05fcae83fc56d76442015cb8a39e9