Analogspannung, Balkenanzeige, Serielle Schnittstelle

Dependencies:   mbed

Revision:
0:cd5a90a3eafd
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Nov 23 07:56:04 2019 +0000
@@ -0,0 +1,17 @@
+#include "mbed.h"
+Serial pc(SERIAL_TX, SERIAL_RX);        // TxD, RxD Definition der Portleitung
+/* ******************** Variablendefinitionen ***************************** */
+
+AnalogIn poti(A3);
+
+float analogwert;
+BusOut vpoti(D2,D3,D6,D9,D11,D12,A6,D13);
+
+int main() 
+{   pc.baud(9600);
+    while(1) 
+    {
+       pc.printf("Spannung=%fV\n",(poti.read())*3.3);
+       vpoti=poti.read_u16()>>8;
+    }
+}