SBC-LCD20x4
SBC-LCD20x4
I2C serial
1. GENERAL INFORMATION
Dear customer,
Thank you for purchasing our product. In the following, we will show you
which things should be noted during the use.
www.joy-it.net
Pascalstr. 8 47506 Neukirchen-Vluyn
2. USE WITH AN ARDUINO
GND GND
5V VCC
SDA SDA
SCL SCL
www.joy-it.net
Pascalstr. 8 47506 Neukirchen-Vluyn
Installation of the library
Before you can transfer the code example to your Arduino, you must
install first the additional library LiquidCrystal_I2C.
This library allows you an easy and fast usage of the display.
Search now in the library manager for the LiquidCrystal_I2C library and
install it.
www.joy-it.net
Pascalstr. 8 47506 Neukirchen-Vluyn
As soon as the library is installed, the installation of the display is finis-
hed. You can now transfer the code example which is described in the
next step and test the display.
Code example
In the following, you can use the code example to test the usage with
your display. Copy this example completely on your Arduino.
Because of the different hardware addresses of the display, you must use
the right address in the code.
Should your display not perform the desired action within the first try,
change the address in the provided lines.
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
//-----Hardware Adressing-----
//In case of wrong function please comment out the up-
per line,
//and release the lower line
LiquidCrystal_I2C lcd(0x27,20,4);
//LiquidCrystal_I2C lcd(0x3F,20,4);
void setup()
{
lcd.init();
}
void loop()
{
lcd.backlight();
//output message
lcd.setCursor(0,0);
lcd.print(" joy-IT");
lcd.setCursor(0,1);
lcd.print(" ");
lcd.setCursor(0,2);
lcd.print(" I2C Serial");
lcd.setCursor(0,3);
lcd.print(" LCD");
}
www.joy-it.net
Pascalstr. 8 47506 Neukirchen-Vluyn
3. USAGE OF THE RASPBERRY PI
www.joy-it.net
Pascalstr. 8 47506 Neukirchen-Vluyn
Raspberry Pi 20 x 4 LCD
Pin 4 (5 V) VCC
If the I2C function is not activated on your Raspberry Pi, you must catch
this up in the settings.
Therefore, open the settings with the following command:
sudo raspi-config
www.joy-it.net
Pascalstr. 8 47506 Neukirchen-Vluyn
Here choose and activate I2C.
Afterwards, you must add the according enry into the module file.
Therefore, open the module file:
i2c-bcm2708
i2c-dev
Save now the filw with the key combination CTRL + O. After that you can
leave the editor with CTRL+ X . Restart now your Raspberry Pi with the
following command:
sudo reboot
www.joy-it.net
Pascalstr. 8 47506 Neukirchen-Vluyn
The output will show the following:
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- 27 -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
The just started test has recognized the I2C signal at the address 27. This
is the standard address of the display. But it also can be found at another
saving address. In such a case, you must change the saving address in the
settings of the driver to your own address.
In the line with ADDRESS=0x27 , you must change the 27 to your own
saving address which was shown in the I2C test. Afterwards, you can
leave the editor with the frequently used key combination.
www.joy-it.net
Pascalstr. 8 47506 Neukirchen-Vluyn
The text within the command lcd.lcd_display_string will be shown on the
display.
The number behind the text issues the line in which the text will be
shown in.
The text can be of course modified to your desires. The editor can be left
with the fundamental key combination.
import lcddriver
from time import *
lcd = lcddriver.lcd()
lcd.lcd_clear()
try:
while True:
lcd.lcd_display_string(" joy-IT", 1)
lcd.lcd_display_string("", 2)
lcd.lcd_display_string(" I2C Serial", 3)
lcd.lcd_display_string(" LCD", 4)
sleep(100)
except KeyboardInterrupt:
lcd.lcd_clear()
www.joy-it.net
Pascalstr. 8 47506 Neukirchen-Vluyn
4. OTHER INFORMATION
Return Options:
As the end user, you can hand over your old appliance (which has
essentially the same functions as the new one bought with us) free of
charge for disposal with the purchase of a new device.
Small devices, which do not have outer dimensions bigger than 25 cm
can be handed in for disposal independently of the
purchase of a new product in normal household quantities.
Published: 14.07.2020