SSD1351 OLED Display¶
ssd1351_spi
Component¶
The ssd1351_spi
display platform allows you to use
SSD1351 (datasheet,
Adafruit 128x128,
Adafruit 128x96,
Waveshare 128x128)
displays with ESPHome. This component is for displays that are connected via the 4-Wire SPI bus.
Connect CLK, DIN, CS, DC, and RST to pins on your ESP. For power, the Adafruit modules have two pins; connect
3.3 volts to their 3v
or connect 5 volts to their +
pin. The Waveshare modules have only a Vcc pin
which should be connected to 3.3 volts only. Connect the GND or G pin to GND.
# Example configuration entry
spi:
clk_pin: D5
mosi_pin: D7
display:
- platform: ssd1351_spi
model: "SSD1351 128x128"
reset_pin: D0
cs_pin: D8
dc_pin: D1
lambda: |-
it.print(0, 0, id(font), "Hello World!");
Configuration variables:¶
model (Required): The model of the display. Options are:
SSD1351 128x128
- SSD1351 with 128 columns and 128 rowsSSD1351 128x96
- SSD1351 with 128 columns and 96 rows
dc_pin (Required, Pin Schema): The DC pin.
cs_pin (Required, Pin Schema): The pin on the ESP that that the CS line is connected to.
reset_pin (Optional, Pin Schema): The RESET pin.
lambda (Optional, lambda): The lambda to use for rendering the content on the display. See Display Rendering Engine for more information.
update_interval (Optional, Time): The interval to re-draw the screen. Defaults to
5s
.pages (Optional, list): Show pages instead of a single lambda. See Display Pages.
id (Optional, ID): Manually specify the ID used for code generation.
Configuration examples¶
Add a color:
section to your YAML configuration; please see color for more detail on this configuration section.
color:
- id: my_red
red: 100%
green: 3%
blue: 5%
...
display:
...
lambda: |-
it.rectangle(0, 0, it.get_width(), it.get_height(), id(my_red));
To bring in color images:
image:
- file: "image.jpg"
id: my_image
resize: 120x120
type: RGB24
...
display:
...
lambda: |-
it.image(0, 0, id(my_image));