I2C LCD used in place of a Parallax 27977 LCD
kayej
Posts: 6
I have several I2C type LCDs laying around, however the project that I am woking on uses a Arduino script for a Parallax 27977 LCD. Is there a way to modify the script to accomodate the I2C rather than the 27977? I now you have to add a differecnt LCD library and change the pin outs etc but would appreciate any guides on how to accomplish this. Thanks
Comments
I have a C library for each of them on the P2. For Arduino you will have to replace the serial object with the Wire object to do I2C.
Mike
Your Parallax Serial LCD uses a microcontroller so the commands are custom to it but it should be using the standard serial library.
Most likely your I2C LCDs just use an "I/O Expander".
Do you know the make and model of your LCDs?
It's been a while since I last used an Arduino but I have several, however I don't remember what type of LCDs I have for them.
It sounds like he has a project that uses the Parallax LCD model and he only has the I2C ones on hand. So he just needs to replace the Serial object used in that project with the Wire (I2C) object he is use to using on his other projects.
The command code set though is going to be different and may need to translate some of the code to make it all work.
Mike
Can you post the script and which LCD you intend to use?
Unfortunately all of my Arduino LCDs are regular so I can't test any code changes.
If so, there are several libraries available. This is a good one, it is frequently updated and will auto-detect the i2C address:
https://github.com/duinoWitchery/hd44780
I see that this program comes from the current issue of QST, so I assume it uses a switch and a Piezo or speaker for sound.
Most of the Parallax LCD commands are defined in the top of the program but there are 2 near the end for the last character of each line.
The Leonardo and Micro use the same chip so you can use either, and they are cheaper than the Uno because it needs a USB chip.
I see that library that Jeff Haas mentioned has code for a number of I2C chips that LCDs use,
The program has the Key attached to Pin D2 which is also the SDA (I2C Data) line used by the WIRE library for I2C.
You still haven't said what I2C LCDs you have.
The key with something like this is to take your time; the way the original author did it may not map 100% onto the replacement library. You'll also want to become familiar with the quirks of LCD displays in general, so I suggest you start by going through the examples from the new library and understand how text is written to the screen, how to position the cursor, how to replace an existing line of text with a new one, etc. There's a few little gotchas with these displays that you have to manage.