Last time we added support for lcd 40×4 by GPIO in direct mode. This time we will add buffered mode.
This time we will add support for Char LCD with size 40×4. Such display is a special case, when we look at the internal schema we will see that its in fact two-in-one lcd. It has two lcds, one lcd goes on top and second on bottom.
It’s because one HD 44780 can display maximum 80 chars and this is 40×2. If we want 160 chars we must double this.
This way we have two 40×2 lcds. For our purpose lets call such display a twin-lcd.
We have a simple virtual display. It can join lcds in one virtual area. But there is one catch. Look at the following layouts (red area is virtual lcd):
No problem. But what about:
… we can’t do it ! And what if we want to use this small 4×4 as second virtual display ? We can’t !
When we add lcd its added at any (x,y) but always starts from (0,0). Lets add an offset, so we can specify area.
Update – error in code. see at the bottom
Lets do some upgrades to our LCD package. I think the best way to do so is to write a simple game.
We will use both screens to display game objects, on one there will be flying DMO (defined moving object :D), and on second lcd – a player. Enemy and player will be trying to hit each other with bullets. Simple concept but exactly what we need.
Lets name it Piader.
Source available at the bottom of this post.
So we can get weather data for our town and it would be good idea to display it somewhere. Time has come to dig into all kinds of LCDs. We will start from basic one – char LCD 20×4 based on HD44780.