Skip to content

Instantly share code, notes, and snippets.

View Oakchris1955's full-sized avatar
🇺🇦
#StandWithUkraine

Oakchris1955 Oakchris1955

🇺🇦
#StandWithUkraine
View GitHub Profile
@Oakchris1955
Oakchris1955 / imageUrl.txt
Created April 9, 2023 15:29
Linux moment
https://imgur.com/a/NmyWf13
@Oakchris1955
Oakchris1955 / main.md
Created December 18, 2022 13:58
Use an I2C-backpacked LCD on the Raspberry Pi with the wiringPi C library

To begin with, wiringPi is a C library mainly used to interface with the Raspberry Pi's GPIO. The library actually includes a LCD header (it is part of the wiringPi dev library, so you must include it as wiringPiDev). However, what wiringPi doesn't include is a LCD header for I2C-backmounted LCDs. Most of the time, the I2C backpack module is just a GPIO expander that communicates with the LCD in 4-bit mode (that is, it only uses 4 data pins instead of 8. While data are sent at half speed, they are still set so fast that you can't tell if an LCD operates in 4-bit or 8-bit mode). We are assuming your LCD can operate in 4-bit mode and that the schematic of your I2C backpack is similar to that of https://manualzz.com/doc/8253437/i2c-lcd-backpack-schematic.

  1. Firstly, check if the wiringPi library is already installed by typing:
gpio readall

to the terminal. If you get something like:

Unable to determine board type