Raspberry Pi: LCD Display - msandholz/RaspberryPi-Tutorials GitHub Wiki

LCD_Display Video: https://www.youtube.com/watch?v=DHbLBTRpTWM

Setup I2C

  1. Enable i2C-Bus in pi@craftbeerpi:~ $ sudo raspi-config

  2. Install i2c-tools with: pi@craftbeerpi:~ $ sudo apt-get install i2c-tools

  3. Check the adress of the LCD-Display: pi@craftbeerpi:~ $ sudo i2cdetect -y 1

  4. Install python libary for i2c: pi@craftbeerpi:~ $ sudo apt-get install python-smbus

  5. Install python libary for LCD Discplay: pi@craftbeerpi:~ $ sudo pip3 install RPLCD

  6. Read the manual fpr PRLCD: https://rplcd.readthedocs.io/en/stable/installation.html#from-pypi

  7. 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')