SO1602A Lib. SO1602A is Organic LED, has 16 chars and 2 lines. This lib supports printf() of C-Language. http://akizukidenshi.com/catalog/g/gP-08276/

Dependents:   NEW_LineTraceHub NEW_LineTraceHub_2 ColorSensorTest

Revision:
1:eef15a16fe7a
Parent:
0:d8b95544d238
Child:
2:45791c1064f6
--- a/SO1602A.cpp	Tue Sep 08 08:35:42 2015 +0000
+++ b/SO1602A.cpp	Wed Sep 09 00:04:00 2015 +0000
@@ -68,9 +68,8 @@
     wait_ms(10);
     this->clear();
     this->cmd(0x02);    //Return Home.
-    this->cmd(0x0f);    // set On/Off. b3=1, b2:Disp, b1:Cursor, b0:blink.
-    this->cmd(0x01);    //Clear Disp.
-    wait_ms(20);
+    this->setDispFlag(true, true, true);
+    
     return;
 }
 
@@ -88,6 +87,22 @@
     return;
 }
 
+void setDispFlag(bool disp, bool cursor, bool blink)
+{
+    // set On/Off. b3=1, b2:Disp, b1:Cursor, b0:blink.
+    char tmp=  0x08;
+    if(disp)
+        tmp += 0x04;
+    if(cursor)
+        tmp += 0x02;
+    if(blink)
+        tmp += 0x01;
+    this->cmd(tmp);
+    this->cmd(0x01);    //Clear Disp.
+    wait_ms(20);
+    return;
+}
+
 void SO1602A::clear()
 {
     this->cmd(0x01);