Raspberry Pi: LCD Display - msandholz/RaspberryPi-Tutorials GitHub Wiki
LCD_Display Video: https://www.youtube.com/watch?v=DHbLBTRpTWM
Setup I2C
-
Enable i2C-Bus in
pi@craftbeerpi:~ $ sudo raspi-config
-
Install i2c-tools with:
pi@craftbeerpi:~ $ sudo apt-get install i2c-tools
-
Check the adress of the LCD-Display:
pi@craftbeerpi:~ $ sudo i2cdetect -y 1
-
Install python libary for i2c:
pi@craftbeerpi:~ $ sudo apt-get install python-smbus
-
Install python libary for LCD Discplay:
pi@craftbeerpi:~ $ sudo pip3 install RPLCD
-
Read the manual fpr PRLCD: https://rplcd.readthedocs.io/en/stable/installation.html#from-pypi
-
Sample Code
#!/usr/bin/python
from RPLCD.i2c import CharLCD
# LCD-Adresse
lcd = CharLCD('PCF8574', 0x27)
lcd.write_string('Raspberry Pi HD44780')
smiley = (0b00000, 0b01010, 0b01010, 0b00000, 0b10001, 0b10001, 0b01110, 0b00000)
lcd.create_char(0, smiley)
lcd.cursor_pos = (2, 0)
lcd.write_string('Hallo Markus \x00')