Analogspannung, Balkenanzeige, Serielle Schnittstelle

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 Serial pc(SERIAL_TX, SERIAL_RX);        // TxD, RxD Definition der Portleitung
00003 /* ******************** Variablendefinitionen ***************************** */
00004 
00005 AnalogIn poti(A3);
00006 
00007 float analogwert;
00008 BusOut vpoti(D2,D3,D6,D9,D11,D12,A6,D13);
00009 
00010 int main() 
00011 {   pc.baud(9600);
00012     while(1) 
00013     {
00014        pc.printf("Spannung=%fV\n",(poti.read())*3.3);
00015        vpoti=poti.read_u16()>>8;
00016     }
00017 }