Dependencies: dispBoB mbed PCA9635
digitalThermometer.cpp@1:1d49d49b77f8, 2011-07-11 (annotated)
- Committer:
- d_worrall
- Date:
- Mon Jul 11 13:57:57 2011 +0000
- Revision:
- 1:1d49d49b77f8
- Parent:
- 0:ba39353df5e7
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
d_worrall | 0:ba39353df5e7 | 1 | #include "mbed.h" |
d_worrall | 0:ba39353df5e7 | 2 | #include "dispBoB.h" |
d_worrall | 0:ba39353df5e7 | 3 | #include "TMP102.h" |
d_worrall | 0:ba39353df5e7 | 4 | |
d_worrall | 0:ba39353df5e7 | 5 | dispBoB db(p28, p27, p26); //instantiate a dispBoB object |
d_worrall | 0:ba39353df5e7 | 6 | TMP102 temperature(p9, p10, 0x90); //instantiate a TMP102 object |
d_worrall | 0:ba39353df5e7 | 7 | |
d_worrall | 1:1d49d49b77f8 | 8 | int main() { |
d_worrall | 1:1d49d49b77f8 | 9 | db.init(); |
d_worrall | 0:ba39353df5e7 | 10 | db.cls(); //clear screen |
d_worrall | 0:ba39353df5e7 | 11 | while(1){ |
d_worrall | 0:ba39353df5e7 | 12 | db.locate(0); //position to start |
d_worrall | 0:ba39353df5e7 | 13 | db.printf("%f", temperature.read()); //print temperature |
d_worrall | 0:ba39353df5e7 | 14 | db.printf("%c", ".C"); //degrees celsius |
d_worrall | 0:ba39353df5e7 | 15 | wait(1); //wait 1 second before looping |
d_worrall | 0:ba39353df5e7 | 16 | } |
d_worrall | 0:ba39353df5e7 | 17 | } |