Bharath S
/
mbed_tempy
Tempy pls
main.cpp@1:a9c3fbd4685f, 2014-05-29 (annotated)
- Committer:
- nbharaths
- Date:
- Thu May 29 04:20:37 2014 +0000
- Revision:
- 1:a9c3fbd4685f
- Parent:
- 0:b0899ab92673
- Child:
- 2:467356f25348
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 | 0:b0899ab92673 | 6 | int main() { |
nbharaths | 0:b0899ab92673 | 7 | while(1) |
nbharaths | 0:b0899ab92673 | 8 | { |
nbharaths | 0:b0899ab92673 | 9 | float temperature=((Temp.read()*3300-2597)/(-13.6)); |
nbharaths | 0:b0899ab92673 | 10 | |
nbharaths | 0:b0899ab92673 | 11 | pc.printf("%f\n",temperature); |
nbharaths | 0:b0899ab92673 | 12 | |
nbharaths | 1:a9c3fbd4685f | 13 | wait(6.0); |
nbharaths | 0:b0899ab92673 | 14 | } |
nbharaths | 0:b0899ab92673 | 15 | |
nbharaths | 1:a9c3fbd4685f | 16 | |
nbharaths | 0:b0899ab92673 | 17 | } |