I2C 接続の温度センサ ADT7410 用のライブラリの使用例. Demo program of the library for temperature sensor ADT7410 connected using I2C interface.

Dependencies:   mbed UIT_ADT7410

Revision:
7:84a9a9455662
Parent:
4:6e320628cbc9
Child:
8:8851e1dcb109
diff -r ab271340d84e -r 84a9a9455662 main.cpp
--- a/main.cpp	Wed Nov 02 07:33:50 2016 +0000
+++ b/main.cpp	Tue Nov 22 03:14:00 2016 +0000
@@ -1,6 +1,6 @@
 //--------------------------------------------------------------
 //  ADT7410 and LCD display using I2C interface
-//  2015/07/25, Copyright (c) 2015 MIKAMI, Naoki
+//  2016/11/22, Copyright (c) 2012 MIKAMI, Naoki
 //--------------------------------------------------------------
 
 #include "ADT7410.hpp"
@@ -40,10 +40,7 @@
         float value = tempr_;
 
 #ifdef USING_AQM1602
-        char str[8];
-        sprintf(str, "%5.1f ", value);
-        string s1 = (string)str + (char)0xDF + "C";
-        lcd_.WriteStringXY(s1, 0, 1);
+        lcd_.WriteValueXY("%5.1f ""\xDF""C", value, 0, 1);
         if (on) lcd_.WriteStringXY(".", 15, 0);
         else    lcd_.WriteStringXY(" ", 15, 0);
         on = !on;