connecting a four line I2C display with the cubieboard is not very difficult, but still it took me some hours. So here I will describe how I got everything working nicely.
I bought a SainSmart 20×4 display on ebay for 12€. Of course you need some wires to connect the display with the cubieboard. I am using 4 jumper cables. The problem is that the cubieboard’s pins are not in the normal 0.1″ raster. So maybe you want to buy something like the “Cubie Proto Board” or the “Cubie Baseboard”. I bought the Cubie Proto Board, because I do not need the additional features of the Baseboard and it is cheaper.
Connecting the display with the cubieboard
The display has four pins: GND, VCC (5v), SDA and SCL. According to the extened pins definition of the cubieboard pin #6 is SCL and pin #7 is SDA (U15 – the pin array near the USB-Ports). I choose to use pin #1 for the 5v and pin #25 for GND (U15 again).
You need Linux running on your cubieboard – android won’t work. I am using cubian. The i2c-dev kernel module needs to be loaded.
With python3 and the quick2wire-python-api it is easy to talk to the LCD, so you need to download and install the api – and python3.
I’ve written a small class that makes it easy to display strings on the LCD (the first argument of the display method is the string, the second the line number). You can find the class here and some demo code here. In the demo you need to change the address to the one of your LCD. You can get the address by running the following command (i2c-tools are needed):
i2cdetect -y 1
When everything is working the result should look like this: