divya kotian
/
lab8_adc
Basic ADC
Revision 0:202c68c58fe6, committed 2021-01-23
- Comitter:
- div1104
- Date:
- Sat Jan 23 16:49:37 2021 +0000
- Commit message:
- ADC
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 202c68c58fe6 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat Jan 23 16:49:37 2021 +0000 @@ -0,0 +1,15 @@ +#include "mbed.h" + +AnalogIn ain(A1); +Serial pc(USBTX,USBRX); + +int main() +{ + float adc_value; + while(1) + { + adc_value=3.3*ain.read(); + pc.printf("Value of ldr= %f \n\r",adc_value); + wait(0.5); + } +}
diff -r 000000000000 -r 202c68c58fe6 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sat Jan 23 16:49:37 2021 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/64910690c574 \ No newline at end of file