Vedran Benc
/
mbed_blinky
Korištenje potenciometra kao analognog ulaza za mbed.
Embed:
(wiki syntax)
Show/hide line numbers
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 }
Generated on Sun Aug 7 2022 17:43:36 by 1.7.2