Continuing on from my last post some progress has been made.
To use my LCDs while keeping the wiring minimal I ordered a few of these I2C adapter boards. These simply connect to the 20 pins on the LCD and allow you to attach the LCD to another device using only 4 wires which keeps your IO pins free for other devices and massively simplifies wiring.
Thanks a lot to Nick Gammon, the process of using KS0108 LCDs with MCP23017 I2C expanders is quite simple.
With this information and the I2C boards arriving I had a shot at getting it all working. After soldering on the board and flashing the example project file I hit an issue.
There seems to be an issue when drawing past the middle of the screen and everything goes wrong from there. I assume there is an issue with the soldering here but as I have 2 LCDs I decided to try again on a new one and fix this one later.
Now this is a bit better!
Now I want to lay out the screen with some info like speed and distance, As I don’t have a GPS module yet, this info will be faked. I wanted to have this screen vertical but that would require modifying the function for drawing letters and it would slow down rendering letters, requiring 8 reads and 8 writes per char vs the current 5 writes. This is because of how writes are done on this LCD, more details can be seen in Nick’s post above. So for now I will keep the screen horizontal.
I made a little example UI of how things could be set out but this will be refined a lot. Example source code.
Whats next: Now that I have the LCD working the next thing I want to do is write some code that allows displaying big digits on the screen for easy readability.
It can be really hard to work out how to use components if no instructions are provided, well known stores like Adafruit and sparkfun provide example usage and libraries but ebay sellers usually do not.
The Arduino Uno is very limited in power and memory which will make some things difficult. Writing to the LCD could be a lot faster if it was possible to buffer the content of the screen on the microcontrollers memory but there is not enough space. A raspberry pi could be used here and should be able to connect to the I2C board fine.
Investigate how to use a component before picking it. Find examples of how it can be used to gauge the difficulty it will be to integrate with the project
Select components that provide a SPI or I2C interface instead of parallel. Pins on the microcontroller are limited and a single LCD can take up almost all of them. This is solved with the I2C add on board.