Diff: I2CTextLCD.cpp
- Revision:
- 3:704f87be7993
- Parent:
- 2:1c5dea5d8783
--- a/I2CTextLCD.cpp Thu Dec 23 12:42:37 2010 +0000 +++ b/I2CTextLCD.cpp Sun Apr 17 17:26:10 2011 +0000 @@ -53,10 +53,10 @@ // send "Display Settings" 3 times (Only top nibble of 0x30 as we've got 4-bit bus) for (int i=0; i<3; i++) { - writeNibble(0x3,false); + writeNibble(EIGHT_BITMODE,false); wait(0.00164); // this command takes 1.64ms, so wait for it } - writeNibble(0x2,false); // 4-bit mode + writeNibble(FOUR_BITMODE,false); // 4-bit mode writeCommand(0x28); // Function set 001 BW N F - - writeCommand(0x0C); @@ -83,9 +83,9 @@ void I2CTextLCD::backlight(bool status) { _backlight=status; if (_backlight) - writeI2CByte(BACKLIGHT_ON | E_ON); + writeI2CByte(BACKLIGHT_ON | E1_ON); else - writeI2CByte(E_ON); + writeI2CByte(E1_ON); } @@ -133,13 +133,13 @@ data = data | RS_ON; // set rs bit } - writeI2CByte(data | E_ON); // E=1 + writeI2CByte(data | E1_ON); // E=1 wait(0.000040f); writeI2CByte(data); // E=0 wait(0.000040f); - writeI2CByte(data | E_ON); // E=1 + writeI2CByte(data | E1_ON); // E=1 } void I2CTextLCD::writeByte(int data, bool rs) { @@ -148,12 +148,12 @@ } void I2CTextLCD::writeCommand(int command) { - //command ^= RS_ON; // RS = 0; + // RS = 0; writeByte(command,false); } void I2CTextLCD::writeData(int data) { - // data = data | RS_ON; //RS = 1 + //RS = 1 writeByte(data,true); _column++;