OLED I2C Interfacing Raspberry Pi Python Code - How to

preview_player
Показать описание
This video provides all required steps to interface or bring up any type OLED with Raspberry Pi and programming it with Python. I used SSD1306 OLED 128x64 with Raspberry Pi. You can find source code in below link. This tutorial will work for any Raspberry Pi 4 or Raspberry Pi 3. Just be careful with hardware connections for Raspberry Pi 4 or Raspberry Pi 3.
Don't forget to LIKE and SUBSCRIBE Channel.

Source Code and Terminal Commands:

Timeline:
00:07 Hardware Connectivity Diagram
00:19 SSH Raspberry Pi
00:27 Installing required applications
02:15 Enable I2C interface on Raspberry Pi
03:21 Python Script to test OLED

Music credit :
––––––––––––––––––––––––––––––
Creative Commons — Creative Commons Attribution 4.0 International License
––––––––––––––––––––––––––––––
Рекомендации по теме
Комментарии
Автор

Thank you! Worked first try, and I have been trying with other videos with no luck.

tomnmt
Автор

may i ask you how to run a Python3 script for my oled i2c display all day as a background process? now i need to manually start the script and as soon as i exit the OLED display turns off..thank you

cristoforopontikas
Автор

Thanks. You say you used it for 128x64 but all the code you posted is for 128x32 (disp = Did you change it? Or like I found in other code (I didn't check yours yet) it's very difficult to use 128x64 even though the module says that what it is. If I leave it at 128x32 I have no problems displaying 4 lines but if I change it to 128x64, the code they suggest, fonts (which I change per their instructions) and what not are unreadable. Have you experienced the same thing?

cjlowe
Автор

I cannot make this work anymore.

First I get an error at the 'sudo pip install Adafruit-SSD1306' command pip command not found
so I tried 'sudo pip3 install Adafruit-SSD1306' instead which seems to work, but I have no idea if that causes other problems.

Second I get:

File "system_stats.py", line 15, in <module>
disp =
File "/usr/local/lib/python2.7/dist-packages/Adafruit_SSD1306/SSD1306.py", line 288, in __init__
gpio, spi, i2c_bus, i2c_address, i2c)
File "/usr/local/lib/python2.7/dist-packages/Adafruit_SSD1306/SSD1306.py", line 85, in __init__
self._gpio = GPIO.get_platform_gpio()
File "/usr/local/lib/python2.7/dist-packages/Adafruit_GPIO/GPIO.py", line 420, in get_platform_gpio
import Adafruit_BBIO.GPIO
ImportError: No module named Adafruit_BBIO.GPIO

Searching online for answers.

Really need help, this is a recurring project that I need to document for network rack.

Can I buy you a cup of coffee?

Thanks

tomnmt