Skip to content

Instantly share code, notes, and snippets.

@chetbox
Last active February 18, 2023 20:26
Show Gist options
  • Save chetbox/840cd8a5a5226faa085cd19846cb7df3 to your computer and use it in GitHub Desktop.
Save chetbox/840cd8a5a5226faa085cd19846cb7df3 to your computer and use it in GitHub Desktop.
Waveshare 1.5" OLED screen Raspberry Pi config
# FBTFT xorg config file
# Assumes you don't have an HDMI screen connected (which would usually be /dev/fb0)
Section "ServerLayout"
Identifier "TFT"
Option "BlankTime" "10"
Screen 0 "ScreenTFT"
EndSection
Section "Screen"
Identifier "ScreenTFT"
Monitor "MonitorTFT"
Device "DeviceTFT"
DefaultDepth 16
SubSection "Display"
Depth 16
Modes "128x128"
EndSubSection
Endsection
Section "Monitor"
Identifier "MonitorTFT"
Endsection
Section "Device"
Identifier "DeviceTFT"
Driver "fbdev"
Option "fbdev" "/dev/fb0"
EndSection

Requires adding user to tty group:

sudo usermod -a -G tty USERNAME
[all]
# Waveshare 1.5" OLED screen
# Using wiring from https://www.waveshare.com/wiki/1.5inch_RGB_OLED_Module#Hardware_connection
dtoverlay=fbtft,spi0-0,ssd1351
dtparam=dc_pin=25
dtparam=reset_pin=27
dtparam=width=128
dtparam=height=128
dtparam=fps=25
dtparam=rotate=0
dtparam=speed=4500000
dtparam=bgr=on
sudo apt install fbi
sudo setcap 'cap_sys_tty_config+ep' $(which fbi)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment