4180

Dependencies:   mbed

Revision:
0:f80f6460d556
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Apr 15 18:23:54 2019 +0000
@@ -0,0 +1,41 @@
+#include "mbed.h"
+
+DigitalOut myled(LED1);
+
+
+
+void printReadings(void const *args) {
+    while(1) {
+        LCD.lock();
+        uLCD.locate(0,1);
+        uLCD.printf(cur_data);
+        uLCD.locate(0,3);
+        for (int i = 0; i < 10; i++) {
+            uLCD.printf(signal[i]);
+            uLCD.printf(" ");
+        }
+        LCD.unlock();
+    }    
+}
+
+int main() {
+    uLCD.cls();
+    uLCD.printf("Change baudrate......");
+    uLCD.baudrate(3000000); //jack up baud rate to max
+    uLCD.background_color(BLACK);
+    uLCD.cls();
+    uLCD.color(WHITE);
+    uLCD.text_height(2);
+    uLCD.text_width(2);
+    
+    Thread thread1(readSensor);
+    Thread thread2(changeValve);
+    Thread thread3(printLCD);
+    
+    while(1) {
+        myled = 1;
+        wait(0.2);
+        myled = 0;
+        wait(0.2);
+    }
+}