I was going to inquire here for help with the DFRobot I2C LCD Arduino library, but I solved my problem. So If you are having issues with the DFRobot I2C LCD read on …
The library linked to on the Robotshop shopping page for the DFRobot I2C / TWI LCD1602 Module part #RB-Dfr-69 did not work well with the Arduino Uno. The Uno did not properly initialize the LCD with the provided library. It may be intermitant or not work at all. Mine would work every so other Arduino “reset”, weird.
Update: RobotShop fixed the DFRobot I2C LCD onsite download libraries. The updated I2C LCD Library can also be found at:
dfrobot.com/image/data/DFR0063/Arduino_library.zip
You can check your current Arduino libraries to see if you have the corrected LiquidCrystal_I2C library. Open the LiquidCrystal_I2C.cpp file, check the the Void …::begin section of code …
*void LiquidCrystal_I2C::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) {
if (lines > 1) {
_displayfunction |= LCD_2LINE;
}
_numlines = lines;
// for some 1 line displays you can select a 10 pixel high font
if ((dotsize != 0) && (lines == 1)) {
_displayfunction |= LCD_5x10DOTS;
}
// SEE PAGE 45/46 FOR INITIALIZATION SPECIFICATION!
// according to datasheet, we need at least 40ms after power rises above 2.7V
// before sending commands. Arduino can turn on way befer 4.5V so we'll wait 50
delayMicroseconds(50000);
// Now we pull both RS and R/W low to begin commands
expanderWrite(_backlightval); // reset expanderand turn backlight off (Bit 8 =1)
delay(1000);
//put the LCD into 4 bit mode
// this is according to the hitachi HD44780 datasheet
// figure 24, pg 46
// we start in 8bit mode, try to set 4 bit mode
**write4bits(0x03);**
delayMicroseconds(4500); // wait min 4.1ms
// second try
**write4bits(0x03);**
delayMicroseconds(4500); // wait min 4.1ms
// third go!
**write4bits(0x03); **
delayMicroseconds(150);
// finally, set to 4-bit interface
**write4bits(0x02); **
The library above will cause the LCD to work intermitantly, sometimes not at all, the correct Library (found at the DFRobot site, see below) shifts the bytes to the left …
write4bits(0x03 << 4); and write4bits(0x02 << 4);
You will also know if you have the corrected library by examining the //quote header of the library
You should see …
//www.DFRobot.com
//last updated on 26/11/2010
//Tim Starling Fixed the reset bug (Thanks Tim)
//wiki doc dfrobot.com/wiki/index.php?title=I2C/TWI_LCD1602_Module_(SKU:_DFR0063
//Support Forum: dfrobot.com/forum/
(If you don’t, checK for the “left shift” code (write4bits(0x0X << 4)) in the ::begin code.)
My LCD projects are now working fine with the new libraries, so if you are having problems with getting the DFRobot I2C LCD to work check your libraries and update your library at the DFRobot LiquidCrystal_I2C library site.
Also the old Robotshop LCD_I2C libaray downloads were double compressed (both ZIPped and RARed) which makes them hard to open, especially on Macs.
Update: RobotShop fixed the DFRobot I2C LCD onsite download libraries. The updated I2C LCD Library can also be found at:
dfrobot.com/image/data/DFR0063/Arduino_library.zip
See my next post here about hooking up your DFRobot I2C LCD and getting it going.
void loop {Arduino(0); cappuccino(0); Arduino(1); cappuccino(1); Arduino(2); cappuccino(2); sleep(8) //hours}
RoboFrog*