Bharath S / Mbed 2 deprecated mbed_tempy

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include"mbed.h"
00002 Serial pc(USBTX,USBRX);
00003 
00004 AnalogIn Temp(p15);
00005 
00006 int main()
00007 {
00008     while(1) {
00009         float a=Temp.read();
00010         float temperature=((a*3300-2629.42504)/(-13.74697));
00011         pc.printf("%f\n",Temp.read());
00012         pc.printf("%f\n",temperature);
00013 
00014         wait(6.0);
00015     }
00016 
00017 
00018 }