hi,
i have this lcd i2c adapter but i have a lot of trouble getting it to work with my 16x2 lcd..
I tried every library that i found for the i2c lcd.. i even found two of them claimed to be for mcp23008 adapter... but the best result was that i could turn the lcd led on and off..
is there any library that someone tested with this particular adapter? or have anybody modified one to work?
Regardless of which library you use you are going to have to know the actual I2C address of your device. The best way to find out is with an I2C port scanner.
You are also going to have to find out if the library expects the true I2C address of the device, which will never be larger than 0x7F (will have a '0' for it's most significant bit), or if it expects the shifted 'slave address' which will always be 'even' (will have a '0' for it's least significant bit.
I suspect that 0x27 may be the actual I2C address in which case 0x6E will be the shifted 'slave address'. I don't know where 0xA7 came from.
I2c scanner found device on adress 0x27, I tried putting 0x6E, and both of this adresses just blinks the lcd backlight... With other adresses and other librarys nothing happens, so i think that this is the closest one to get it work...
the library that almost works is this
I personally wouldn't trust any library that expected you to use a slave address instead of the actual address. The conversion of the address is something that I would expect any competent programmer to handle within the library.
Why don't you stick to using the actual address (0x27) now that you know what it is, and try your libraries again?
The first thing that I did when i connected this adapter is that i used the scanner to find the adress, then i tried all the libraries with that adress including few other adresses that i could think of, even if i knew my adress but this was my desperate move...
I'm working on modifying a library to work on that I2C adapter. I got most of it working now, just want to make it a little more like the liquidcrystal library so I don't have to remember different commands...
The Adafruit i2c board uses this chip.
See this project:
The adafruit library is LiquidCrystal compatible but you will have to modify
the pin mappings in the code since the board you have doesn't map the pins the same.
(The adafruit code does not allow configuring the pin mappings from the sketch).
FalconFour's code is much faster but hardcoded in a way that is more difficult
to modify the mappings.
I'm in the process of creating an addition to fm's new LiquidCrystal library to support this chip.
I'm not quite finished with it.
wabbitguy:
No idea if the library I got from Wide.HK that I modified and enhanced works on the Adafruit LCD,
It won't. The pin mapping from the mcp23008 to the hd44780 interface and backlight pin are different.
--- bill
After looking at the Adafruit one I sort of suspected that.
The I2C backpack from Wide.HK is available either as a stand alone version you solder on, or pre-installed on some of their LCD's (all 2x16's from what I saw). Normally I use the I2C from YWRobot and the LiquidCrystal_IC2 library. But I spotted the Wide.HK LCD that has the green characters on a black background and I got one for a project.
Although I'm not too impressed with the library Wide.HK supplies (it won't compile on Arduino V1.0 or newer), it did give me a basic library starting point I could modify so I could use the display. Nice LCD display though...
wabbitguy:
No idea if the library I got from Wide.HK that I modified and enhanced works on the Adafruit LCD, but it works just fine on my Wide.HK LCD's now.
Mel, thanks for this ! I bought one of these screen on fleybay as you did, and was banging my head on the desk for hours trying their library and code, and hundreds of other IC2 LCD libraries from the web. Just as I was about to give up and bin it, I found your BLOG ... works like a dream now !
wabbitguy:
I updated the library today and added the capability of the print class. Only took me six tries to get it working right, but working it is...
BigMrTong:
Mel, thanks for this ! I bought one of these screen on fleybay as you did, and was banging my head on the desk for hours trying their library and code, and hundreds of other IC2 LCD libraries from the web. Just as I was about to give up and bin it, I found your BLOG ... works like a dream now !
Thanks very much!
I've contacted WideHK a number of times about giving their purchasers the updated library, and they could host it themselves or just give them a link to mine. WideHK has acknowledged that they got my info and it's been months and nothing has changed. Still the same old buggy library from them.
Their attitude doesn't make any sense to me at all.
wabbitguy:
No idea if the library I got from Wide.HK that I modified and enhanced works on the Adafruit LCD, but it works just fine on my Wide.HK LCD's now.
Hi wabbitguy. You are truly great to share this code, which works GREAT! I stayed up last night until 4AM trying every bloody library I could find, including the garbage library and example code from wide.hk, which did not work. Your code works great and I am now using the three LCDs from wide.hk in my projects. Thanks again! XD
PS. I registered solely to thank you for the code you posted.
Goduino:
Hi wabbitguy. You are truly great to share this code, which works GREAT! I stayed up last night until 4AM trying every bloody library I could find, including the garbage library and example code from wide.hk, which did not work. Your code works great and I am now using the three LCDs from wide.hk in my projects. Thanks again! XD
PS. I registered solely to thank you for the code you posted.
As I sit here blushing...thanks very much! I really appreciate it!
I'm still using the WideHK displays in my own projects too. I like those green on black displays they have.