Revision:
1:0eb3365ec819
Parent:
0:9218cf335f9b
Child:
2:1c5dea5d8783
--- a/I2CTextLCD.cpp	Sat Dec 18 20:06:14 2010 +0000
+++ b/I2CTextLCD.cpp	Sun Dec 19 19:19:39 2010 +0000
@@ -42,7 +42,7 @@
     _i2cAddress = i2cAddress;
     _columns = columns;
     _rows = rows;
-
+    _backlight=true;
 
     // Should theoretically wait 15ms, but most things will be powered up pre-reset
     // so i'll disable that for the minute. If implemented, could wait 15ms post reset
@@ -77,6 +77,11 @@
     return 0;
 }
 
+void I2CTextLCD::backlight(bool on) {
+  _backlight=on;
+}
+
+
 void I2CTextLCD::newline() {
     _column = 0;
     _row++;
@@ -113,6 +118,10 @@
 
     data = (data & 0xF);
 
+
+    if (_backlight)
+        data= data  | BACKLIGHT_ON;
+
     if (rs) {
         data = data | RS_ON; // set rs bit
     }
@@ -152,3 +161,5 @@
     cmd[1] = (data >> 8);
     _i2c.write(_i2cAddress, cmd, 2);
 }
+
+