Javier Nuñez
/
Seleccion_Analogico
Seleccion_Lectura_Analoga
Revision 0:54b929652f60, committed 2020-02-01
- Comitter:
- javierdavid2006
- Date:
- Sat Feb 01 19:15:08 2020 +0000
- Commit message:
- Seleccion_Lectura_Analogo
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 54b929652f60 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat Feb 01 19:15:08 2020 +0000 @@ -0,0 +1,30 @@ +#include "mbed.h" +Serial device(PA_2,PA_3); +AnalogIn ain1(PB_0); +AnalogIn ain2(PB_1); +DigitalIn i(PA_0); + + + +int main() +{ + device.baud(115200); + + while(1) { + int b = 0; + if (b==0 and i == 1) { + float POT = ain1.read(); + device.printf("EL valor analogo AIN1 es : %f \r\n", POT); + b=1; + wait(0.5); + if (b==1 and i == 1) { + float POT = ain2.read(); + device.printf("EL valor analogo AIN2 es: %f \r\n", POT); + wait(0.5); + b=0; + } + } + } + + +}
diff -r 000000000000 -r 54b929652f60 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sat Feb 01 19:15:08 2020 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file