Below is how I connected a 128×32 Blue OLED to a Raspberry Pi.
The OLED screens are quite cheap on eBAY (I would suggest ordering a few as some I received were damaged, they are quite fragile)
Hardware Setup
Connect the 3.3 to VCC pin
Connect the ground
Connect SCL to SCL pin on your Pi
Connect SAA to the SDA pin on your Pi
Setup the Python Library
$ git clone https://github.com/adafruit/Adafruit_Python_SSD1306.git
$ cd Adafruit_Python_SSD1306
$ sudo python setup.py install
Now you can copy the desired ./examples/ scripts anywhere and choose the module you have wired up
..
# 128×32 display with hardware I2C:
# 128×64 display with hardware I2C:
# 128×32 display with hardware SPI:
# 128×64 display with hardware SPI:
..
Run the script
sudo python mylcdscript.pl
Stats example
Animate example
Run at startup
Type the following to open your crontab
sudo crontab -e
Now add the following line
@reboot sudo python /scripts/mylcdscript.pl > /scripts/mylcdscript.log
Reboot your system
sudo shutdown -r now
TIP: Consider changing the sleep in the while loop to 120 instead of 0.1 to prevent flooding I2C
More Reading
I used this guuide to setup my OLED
I hope this guide helps someone.
Ask a question or recommend an article
[contact-form-7 id=”30″ title=”Ask a Question”]
Revision History
v1.0 Initial post