gpio lcd

Using HD44780 on Raspberry Pi – part 5: 40×4 (direct access)

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.

Download source

Older parts


Virtual display – part 2: offsets

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

Download source


Piader – upgrade LCD by game – part 1

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.