Driver for a Text LCD using a PCF8574 over I2C

Dependencies:   mbed

Fork of I2CTextLCD by Romilly Cocking

Revision:
1:eac18254e072
Parent:
0:6beb6f498640
--- a/TextLCD.cpp	Mon Aug 09 14:17:02 2010 +0000
+++ b/TextLCD.cpp	Thu Jan 14 09:48:50 2016 +0000
@@ -50,9 +50,9 @@
 */
 #include "TextLCD.h"
 #include "mbed.h"
+//nclude "PCF8574.h"
 
-TextLCD::TextLCD(PinName sda, PinName scl, int i2cAddress, LCDType type) : _i2c(sda, scl),
-        _type(type) {
+TextLCD::TextLCD(PinName sda, PinName scl, int i2cAddress, LCDType type) : _i2c(sda, scl), _type(type) {
     _i2cAddress = i2cAddress;
     wait(0.015);        // Wait 15ms to ensure powered up
 
@@ -120,6 +120,8 @@
 }
 
 void TextLCD::writeNibble(int data, bool rs) {
+    data = data << 4;
+    data |= BL_ON; // E on
     if (rs) {
         data = data | RS_ON; // set rs bit
     }