I2C 接続の LCD AQM1602XA-RN-GBW 用のライブラリ. Library for LCD 1602XA-RN-GBW connected using I2C interface.

Dependents:   UIT2_MovingAv_Intr UIT2_VariableFIR UIT2_VowelSynthesizer UIT2_ALE_LeakyLMS ... more

Revision:
9:74a845df6e7a
Parent:
8:854c244a7863
Child:
10:6e6c0f24e81f
--- a/AQM1602.hpp	Thu Jan 14 05:55:06 2016 +0000
+++ b/AQM1602.hpp	Fri Apr 01 04:26:30 2016 +0000
@@ -6,7 +6,7 @@
 //      D14  SDA ---- to pin4 of LCD module
 //      D15  SCL ---- to pin3 of LCD module
 //
-//  2016/01/14, Copyright (c) 2015 MIKAMI, Naoki
+//  2016/04/01, Copyright (c) 2016 MIKAMI, Naoki
 //-------------------------------------------------------
 
 #ifndef AQM1602I2C_HPP
@@ -68,6 +68,22 @@
         void WriteStringXY(const string str, uint8_t x, uint8_t y)
         { WriteStringXY(str.c_str(), x, y); }
 
+        // Write numerical value
+        template <typename T> void WriteValue(const char fmt[], T value)
+        {
+            char str[17];
+            sprintf(str, fmt, value);
+            WriteString(str);
+        }
+
+        // Write numerical value from specified position
+        template <typename T>
+        void WriteValueXY(const char fmt[], T value, uint8_t x, uint8_t y)
+        {
+            SetXY(x, y);
+            WriteValue(fmt, value);
+        }
+
         // Clear of specified line
         void ClearLine(uint8_t line);