Vedran Benc
/
mbed_blinky
Korištenje potenciometra kao analognog ulaza za mbed.
Diff: main.cpp
- Revision:
- 0:e9979a85562b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Nov 04 08:07:44 2016 +0000 @@ -0,0 +1,14 @@ +//Reads input through the ADC, and transfers to PC terminal +#include "mbed.h" +Serial pc(USBTX, USBRX); +AnalogIn Ain(p20); +float ADCdata; +int main() +{ + pc.printf("ADC Data Values... \n\r"); + while (1) { + ADCdata=Ain*3.3; + pc.printf("Napon je: %.2f \n\r",ADCdata); + wait (0.5); + } +} \ No newline at end of file