Simple libary for AQM1602XA I2C Character LCD.

Revision:
0:933748ca1307
Child:
1:4fca021edef0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/AQM1602XA.h	Sun Apr 24 11:50:38 2016 +0000
@@ -0,0 +1,40 @@
+/**
+ * Simple class to handle I2C 16 chars x 2 rows Character LCD
+ * By K. Tsubaki
+ * Date: 2016/04/24
+ * Tested with: mbed LPC1114
+ * Usage: 
+ *        mbed <---> LCD
+ *        dp5  <---> SDA
+ *        dp27 <---> SCL
+ *        VIN  <---> +V
+ *        GND  <---> GND
+ **/
+#ifndef __AQM1602XA__
+
+#include "mbed.h"
+
+#define AQM1602XA_ADDR          (0x3E << 1)
+
+class AQM1602XA {
+    private:
+        I2C         wire;
+        char        address;
+        
+        void initialize(void);
+        void writeCommand(char cmd);
+        void writeData(char data);
+    public:
+        /**
+         * Constructor - default device address is 0x3E
+         **/
+        AQM1602XA(PinName sda, PinName scl, char slave_adr = AQM1602XA_ADDR);
+        /**
+         * print characters on the LCD
+         * params: row (0 or 1)
+         *         str - string to show on the LCD. The length is up to 16 characters
+         **/
+        void printString(int row, char *str);
+};
+
+#endif