Add SSD1331 docs (#729)

This commit is contained in:
Keith Burzinski 2020-11-18 00:35:00 -06:00 committed by GitHub
parent 3b5f63176f
commit 7c01d10fbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 101 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

View File

@ -0,0 +1,100 @@
SSD1331 OLED Display
====================
.. seo::
:description: Instructions for setting up SSD1331 OLED display drivers.
:image: ssd1331.jpg
.. _ssd1331-spi:
Usage
-----
The ``ssd1331_spi`` display platform allows you to use
SSD1331 (`datasheet <https://cdn-shop.adafruit.com/datasheets/SSD1331_1.2.pdf>`__,
`Adafruit <https://www.adafruit.com/product/684>`__)
displays with ESPHome. This component is for displays that are connected via the 4-Wire :ref:`SPI bus <spi>`.
.. figure:: images/ssd1331-full.jpg
:align: center
:width: 75.0%
SSD1331 96x64 OLED Display
Connect CLK (CK), MOSI (SI), CS (OC), DC, and RST (R) to pins on your ESP. For power, the Adafruit modules
require 5 volts connected to their ``+`` pin. Connect the GND or G pin to ground.
.. code-block:: yaml
# Example configuration entry
spi:
clk_pin: D5
mosi_pin: D7
display:
- platform: ssd1331_spi
reset_pin: D0
cs_pin: D8
dc_pin: D1
lambda: |-
it.print(0, 0, id(font), "Hello World!");
Configuration variables
***********************
- **reset_pin** (:ref:`Pin Schema <config-pin_schema>`): The RESET pin.
- **cs_pin** (*Optional*, :ref:`Pin Schema <config-pin_schema>`): The pin on the ESP that that the CS line is connected to.
The CS line can be connected to GND if this is the only device on the SPI bus.
- **dc_pin** (:ref:`Pin Schema <config-pin_schema>`): The DC pin.
- **lambda** (*Optional*, :ref:`lambda <config-lambda>`): The lambda to use for rendering the content on the display.
See :ref:`display-engine` for more information.
- **update_interval** (*Optional*, :ref:`config-time`): The interval to re-draw the screen. Defaults to ``5s``.
- **pages** (*Optional*, list): Show pages instead of a single lambda. See :ref:`display-pages`.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
Configuration examples
**********************
You may wish to add a ``color:`` section to your YAML configuration to make using colors easier; please see
:ref:`color <config-color>` for more detail on this optional configuration section.
.. code-block:: yaml
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:
.. code-block:: yaml
image:
- file: "image.jpg"
id: my_image
resize: 96x64
type: RGB
...
display:
...
lambda: |-
it.image(0, 0, id(my_image));
See Also
--------
- :doc:`index`
- :apiref:`ssd1331_base/ssd1331_base.h`
- `SSD1331 Library <https://github.com/adafruit/Adafruit-SSD1331-OLED-Driver-Library-for-Arduino>`__ by `Adafruit <https://www.adafruit.com/>`__
- :ghedit:`Edit`

BIN
images/ssd1331.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@ -280,6 +280,7 @@ Display Components
Nextion, components/display/nextion, nextion.jpg
SSD1306, components/display/ssd1306, ssd1306.jpg
SSD1325, components/display/ssd1325, ssd1325.jpg
SSD1331, components/display/ssd1331, ssd1331.jpg
SSD1351, components/display/ssd1351, ssd1351.jpg
ST7789V, components/display/st7789v, st7789v.jpg
Waveshare E-Paper, components/display/waveshare_epaper, waveshare_epaper.jpg