Pranoy Varma
/
temp_sense
drndr
Diff: main.cpp
- Revision:
- 0:ee02b824c067
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri May 30 05:07:56 2014 +0000 @@ -0,0 +1,21 @@ +#include"mbed.h" +Serial pc(USBTX,USBRX); + +AnalogIn Temp(p15); + +int main() { +while(1) +{ + float v; + //float err; + float t; + v=Temp.read()*3.3; + //err=(0.0045258273617072818*v*v)+(0.0045258273617072818*v)+(0.0045258273617072818); + v*=1000; + t=(-2.6832707076280613e-06*v*v)+(-0.08245303062744605*v)+184.95817690782815; + pc.printf("\nThe temperature is %f",t); + pc.printf("\nTemp.read() is %f",v); + wait(6.0); +} + +} \ No newline at end of file