![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
SPI 接続の温度センサ ADT7310 用のライブラリの使用例. Demo program of the library for temperature sensor ADT7310 connected using SPI interface.
Dependencies: UIT_ADT7310 UIT_AQM1602 mbed
Diff: main.cpp
- Revision:
- 1:649b6f2b8f38
- Parent:
- 0:563b65e407e1
- Child:
- 2:6b7bb0e0949a
--- a/main.cpp Sat Jun 27 08:10:53 2015 +0000 +++ b/main.cpp Sun Jun 28 09:29:10 2015 +0000 @@ -3,7 +3,7 @@ // このプログラムは printf() 文でマルチバイト文字“℃”を使って // いるので,コンパイル時に警告が出る // -// 2015/06/27, Copyright (c) 2015 MIKAMI, Naoki +// 2015/06/28, Copyright (c) 2015 MIKAMI, Naoki //-------------------------------------------------------------- #define ADT7310_DEBUG // デバッグの場合 @@ -28,6 +28,7 @@ { printf("\r\nStart dual ADT7310s\r\n"); #ifdef USING_AQM1602 + bool on = true; lcd_.WriteStringXY("Dual ADT7310s", 0, 0); #endif /* @@ -52,6 +53,9 @@ sprintf(str, "%5.1f, %5.1f ", tempr1, tempr2); string s1 = (string)str + (char)0xDF + "C"; lcd_.WriteStringXY(s1, 0, 1); + if (on) lcd_.WriteStringXY(".", 15, 0); + else lcd_.WriteStringXY(" ", 15, 0); + on = !on; #endif wait(1); }