Korištenje potenciometra kao analognog ulaza za mbed.

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 //Reads input through the ADC, and transfers to PC terminal
00002 #include "mbed.h"
00003 Serial pc(USBTX, USBRX);
00004 AnalogIn Ain(p20);
00005 float ADCdata;
00006 int main()
00007 {
00008     pc.printf("ADC Data Values... \n\r");
00009     while (1) {
00010         ADCdata=Ain*3.3;
00011         pc.printf("Napon je: %.2f \n\r",ADCdata);
00012         wait (0.5);
00013     }
00014 }