Poti einlesen

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Polteko123
Date:
Mon Feb 22 13:36:20 2016 +0000
Parent:
0:359d94500b26
Commit message:
neu poti

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 359d94500b26 -r ca47950c1c03 main.cpp
--- a/main.cpp	Mon Feb 22 13:15:40 2016 +0000
+++ b/main.cpp	Mon Feb 22 13:36:20 2016 +0000
@@ -4,8 +4,8 @@
 BusOut aus(P1_13,P1_12,P1_7,P1_6,P1_4,P1_3,P1_1,P1_0,LED4,LED3,LED2,LED1);
 
 int main() {
-    float a; 
-    int b;
+    float ausgabe; 
+    int wert;
     int c = 2;
     int i = 1;
 
@@ -13,17 +13,17 @@
     {
         c = 2;
         i = 1;
-        a = poti1.read();
-        b = a*12;
+        ausgabe = poti1.read();
+        wert = ausgabe*12;
         
-        while(i<b)
+        while(i<wert)
         {
-        c = c * 2;
-        i++;
+            c = c * 2;
+            i++;
         }
         
-        if(b == 0)
-        c = 1;
+        if(wert == 0)
+            c = 1;
         
         
         aus = c-1;