Another guide for wiring the OLED 128×64 Display Monochrome on Raspberry Pi. These display module has only 0.96” diagonal made of 128×64 OLED pixels, this module it works without backlight can be visible in the dark environment, and OLED display is higher compared to LCD display. This OLED Display driven by SSD1306 chip compatible with i2C or SPI Bus communication, as you can see there are 2 resistors at the back of the module and sick-screen to see how to set the communication mode, the default mode is 4wire SPI mode except VCC and GND, 4wires would be need when using 4wires SPI mode. You can also set to the I2C mode, in which mode 2 control wires is needed. As you can see the diagram below there are two wir1ing diagram, both diagram use the SSD1306 Python Code Library witch is provided by Adafruit.
Required Components
- Raspberry Pi / Banana Pi / Orange Pi (If your using Banana Pi or Orange Pi See first the GPIO Pins)
- OLED Display Module
- Solder Less Breadboard
- Jumper Wires / DuPont Wires
Wiring diagram for I2C
Wiring diagram for SPI
Setting up the Raspberry Pi
Python Test Source Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
import Adafruit_GPIO.SPI as SPI import Adafruit_SSD1306 from PIL import Image from PIL import ImageDraw from PIL import ImageFont disp = Adafruit_SSD1306.SSD1306_128_64(rst=24, dc=23, spi=SPI.SpiDev(0, 0, max_speed_hz=8000000)) disp.begin() disp.clear() disp.display() image = Image.new('1', (disp.width, disp.height)) draw = ImageDraw.Draw(image) draw.rectangle((0,0,disp.width-1,disp.height-1), outline=1, fill=0) font = ImageFont.load_default() draw.text((16, 24),'14CORE | OLED TEST CODE', font=font, fill=255) disp.image(image) disp.display() |
Download the Python SSD1306 Library Here | Zip
Hi I can not find the methods and their explanation of the Adafruit_SSD1306 library.
Where to find that please? Thx in advance.
Follow the link below….
https://www.14core.com/wp-content/uploads/2020/01/circuitpython-readthedocs-io-ssd1306-en-latest.pdf