![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Nucleo_display_temp_LM35
main.cpp
- Committer:
- anywill
- Date:
- 2016-10-19
- Revision:
- 0:a854d9a733ca
- Child:
- 1:b78c70e272ae
File content as of revision 0:a854d9a733ca:
#include "mbed.h" //#include "TimeManagement.h" //DigitalOut myled(LED1); AnalogIn in(A5); Serial pc(USBTX,USBRX); int main() { float value; while(1) { value=in; pc.printf("\n \r Analog value %f", value); float cel=value*100 ;//x读取A0口的电压值 float vol = n * (5.0 / 4096.0*100); //读取A0口的电压值 float vol = n * (5.0 / 1023.0*100); pc.printf("\n \r Temperature value %f", cel); // pc.printf("%s ", time); wait(1.0); } }