poti

Dependencies:   C12832_lcd mbed

Revision:
0:444de0e15eae
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Temperatur_einlesen.cpp	Thu Jan 28 19:54:31 2016 +0000
@@ -0,0 +1,44 @@
+#include "mbed.h"
+#include "C12832_lcd.h"
+
+//Poti1 und Poti2 extra einlesen ud auf 2 Zeilen am Display ausgeben
+//Poti1 hat die höchstmögliche Abtastfrequenz (sampletime)
+//Poti2 hat eine sehr niedrige Abtastfrequenz
+
+AnalogIn pot1(p19);
+AnalogIn pot2(p20);
+C12832_LCD lcd;
+Ticker t1, t2;
+bool updateLcd = true;
+
+
+void Pot1()
+{
+    lcd.locate(0,5);
+    lcd.printf("Port 1: %f ",pot1.read());
+    }
+    
+void Pot2()
+{
+    lcd.locate(0,15);
+    lcd.printf("Port 2: %u ",pot2.read_u16());
+    }   
+    
+     
+int main() {
+    
+    lcd.cls();
+
+    t1.attach(&Pot1, 1.00);
+    t2.attach(&Pot2, 0.10);
+    
+    while(1)
+    {
+        if (updateLcd) 
+            updateLcd = false;
+        
+
+        
+
+        }
+}