
A test program for LM75B temperature sensor
Revision 1:3dff1e886346, committed 2017-04-24
- Comitter:
- Rhyme
- Date:
- Mon Apr 24 07:32:31 2017 +0000
- Parent:
- 0:7dd6fe5e908d
- Commit message:
- Title and format modified for CSV
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 7dd6fe5e908d -r 3dff1e886346 main.cpp --- a/main.cpp Wed Jul 06 07:30:12 2016 +0000 +++ b/main.cpp Mon Apr 24 07:32:31 2017 +0000 @@ -8,10 +8,14 @@ float ftemp = 0.0 ; LM75B lm75b(PIN_SDA, PIN_SCL, LM75B_I2C_ADDRESS) ; + printf("=== test LM75B for %s (%s) ===\n", BOARD_NAME, __DATE__) ; + printf("Temperature (int) C, Temperature (float) C\n") ; + while(1) { itemp = lm75b.temp() ; lm75b.getTemp(&ftemp) ; - printf("Temp = %d C degree, %.3f C degree\n", itemp, ftemp) ; +// printf("Temp = %d C degree, %.3f C degree\n", itemp, ftemp) ; + printf("%4d, %4.3f\n", itemp, ftemp) ; wait(1) ; } } \ No newline at end of file