Match Lab
/
Thermometer
LM61 thermometer progaram.
main.cpp@0:b13afce839ec, 2015-03-04 (annotated)
- Committer:
- Match314
- Date:
- Wed Mar 04 10:44:47 2015 +0000
- Revision:
- 0:b13afce839ec
Up
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Match314 | 0:b13afce839ec | 1 | #include "LM61.h" |
Match314 | 0:b13afce839ec | 2 | #include "mbed.h" |
Match314 | 0:b13afce839ec | 3 | |
Match314 | 0:b13afce839ec | 4 | LM61 lm61(p15); // Connect to Vout pin in LM61. |
Match314 | 0:b13afce839ec | 5 | Serial pc(USBTX, USBRX); |
Match314 | 0:b13afce839ec | 6 | |
Match314 | 0:b13afce839ec | 7 | int main() { |
Match314 | 0:b13afce839ec | 8 | float temp; |
Match314 | 0:b13afce839ec | 9 | pc.baud(921600); |
Match314 | 0:b13afce839ec | 10 | |
Match314 | 0:b13afce839ec | 11 | while(1) { |
Match314 | 0:b13afce839ec | 12 | temp = lm61.GetTemp(); |
Match314 | 0:b13afce839ec | 13 | pc.printf("Temp=%5.1f\r\n", temp); |
Match314 | 0:b13afce839ec | 14 | wait(1); |
Match314 | 0:b13afce839ec | 15 | } |
Match314 | 0:b13afce839ec | 16 | } |