![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Visualizando la temperatura a traves de la adquisicion de señal en el canal A0 usando el sensor de temperatura LM35
main.cpp@0:475b07e6fa3b, 2021-11-30 (annotated)
- Committer:
- diego_27
- Date:
- Tue Nov 30 19:17:47 2021 +0000
- Revision:
- 0:475b07e6fa3b
Visualizando la temperatura a traves del canal ADC con un sensor LM35
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
diego_27 | 0:475b07e6fa3b | 1 | #include "mbed.h" |
diego_27 | 0:475b07e6fa3b | 2 | Serial bt(PA_9,PA_10,9600); //Comunicacion con el modulo HC-06 |
diego_27 | 0:475b07e6fa3b | 3 | AnalogIn T(A0); |
diego_27 | 0:475b07e6fa3b | 4 | int main(){ |
diego_27 | 0:475b07e6fa3b | 5 | float t=0; |
diego_27 | 0:475b07e6fa3b | 6 | while(1){ |
diego_27 | 0:475b07e6fa3b | 7 | wait(.2); |
diego_27 | 0:475b07e6fa3b | 8 | t=T.read(); |
diego_27 | 0:475b07e6fa3b | 9 | t=(t*6)*100; |
diego_27 | 0:475b07e6fa3b | 10 | bt.printf("Temperatura en Orizaba, Veracruz es de: %f \r\n", t); |
diego_27 | 0:475b07e6fa3b | 11 | } |
diego_27 | 0:475b07e6fa3b | 12 | |
diego_27 | 0:475b07e6fa3b | 13 | } |