Bharath S
/
mbed_tempy
Tempy pls
main.cpp@2:467356f25348, 2014-05-29 (annotated)
- Committer:
- nbharaths
- Date:
- Thu May 29 08:42:12 2014 +0000
- Revision:
- 2:467356f25348
- Parent:
- 1:a9c3fbd4685f
Temp sens w/ delay; ;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nbharaths | 0:b0899ab92673 | 1 | #include"mbed.h" |
nbharaths | 0:b0899ab92673 | 2 | Serial pc(USBTX,USBRX); |
nbharaths | 0:b0899ab92673 | 3 | |
nbharaths | 0:b0899ab92673 | 4 | AnalogIn Temp(p15); |
nbharaths | 0:b0899ab92673 | 5 | |
nbharaths | 2:467356f25348 | 6 | int main() |
nbharaths | 0:b0899ab92673 | 7 | { |
nbharaths | 2:467356f25348 | 8 | while(1) { |
nbharaths | 2:467356f25348 | 9 | float a=Temp.read(); |
nbharaths | 2:467356f25348 | 10 | float temperature=((a*3300-2629.42504)/(-13.74697)); |
nbharaths | 2:467356f25348 | 11 | pc.printf("%f\n",Temp.read()); |
nbharaths | 2:467356f25348 | 12 | pc.printf("%f\n",temperature); |
nbharaths | 2:467356f25348 | 13 | |
nbharaths | 2:467356f25348 | 14 | wait(6.0); |
nbharaths | 2:467356f25348 | 15 | } |
nbharaths | 2:467356f25348 | 16 | |
nbharaths | 1:a9c3fbd4685f | 17 | |
nbharaths | 0:b0899ab92673 | 18 | } |