POti einlesen und an der Seriellen Schnittstelle formatiert den Wert ausgeben Analog/Digital

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
happy_alien
Date:
Mon Jan 13 17:29:59 2020 +0000
Commit message:
Poti einesen

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r b0e658209625 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Jan 13 17:29:59 2020 +0000
@@ -0,0 +1,35 @@
+#include "mbed.h"
+
+Serial pc(USBTX, USBRX);
+AnalogIn poti(p15);
+void Test1();
+void Test2();
+
+
+int main()
+{  
+    
+    pc.baud(115200 );
+
+    Test2(); 
+    
+    
+}
+void Test2()
+{ int val=0;
+  while(1)
+    {   val=poti.read_u16()>>6;
+        pc.printf("Poti %i \n",val);
+        wait_ms(300);
+    }   
+}
+
+void Test1()
+{ int val =0;
+  while(1)
+    {   
+        pc.printf("Hallo %i \n",val++);
+        wait_ms(1000);
+    }   
+}
+
diff -r 000000000000 -r b0e658209625 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Jan 13 17:29:59 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file