Josef Humer
/
0000_CAMPUS_POTI
Analogspannung, Balkenanzeige, Serielle Schnittstelle
main.cpp
- Committer:
- heseg
- Date:
- 2019-11-23
- Revision:
- 0:cd5a90a3eafd
File content as of revision 0:cd5a90a3eafd:
#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; } }