Homepage Wiki Forum Buy

Display 4x20

From GNUBLIN

Difficulty Condition Gnublin Familie
Gnublin logo easy.png Basics Konsole All

Contents


Quickstart

The display described here is controlled via the I2C interface. This article describes how to easily display the joins to the GNUBLIN and this then triggers a program. Essentially, the display must only be connected. For the control you ever a program was written.

As display BC2004A was used.

The display must be initialized before use:

root@gnublin:~# gnublin-lcd -i

With the command:

root@gnublin:~# gnublin-lcd -d

you can clear the display.

Now you can write a sentence to the screen.

root@gnublin:~# gnublin-lcd -d -w "Hallo GNUBLIN"

These commands can also be combined, for example

root@gnublin:~# gnublin-lcd -a 0x20 -i -d -B 1 -o 3 -l 2 -w "Hello GNUBLIN"

So easily Can be a output to a display :).

You get an overview of all possible commands by using the help option.

root@gnublin:~# gnublin-lcd -h
This program is designed, to easily interact with a 4x20 Display connected to the GNUBLIN.
-h Show this help
-f <device> Specify the i2c-device.default=/dev/i2c-1
-j Convert output to json format.
-a <I2C-address> Specify the display module's I2C-address.default=0x20
-i Initialize the Display
-o <column> Moves the cursor to the Position X (0-19)
-l <line> Moves the cursor to the Line Y (1-4)
-w <string> Prints the String to the Display
-d clears the Display
-B let the cursor blink(1/0)
-u Shows the cUrsor(_)(1/0)
Examples:
gnublin-lcd -a 0x20 -i
gnublin-lcd -a 0x20 -c -B 1 -o 3 -l 2 -w "Hello World"

Using the buttons

On the PCB of the Display are also five buttons. You can get access to these over the build in PCA9555 chip like it is used on the GNUBLIN Module-Portexpander.

The buttons are connected to the Pin 11 - 15 of the PCA9555 so you can easily read them out by using the GNUBLIN-Tool gnublin-pca9555.

root@gnublin:~# gnublin-pca9555 -i -p 11

This will read out the first button on pin 11.

In other languages