ST7920 LCD Graphic Display ========================== .. seo:: :description: Instructions for setting up ST7920 LCD display drivers. :image: st7920.jpg .. _st7920: Usage ----- The ``st7920`` display platform allows you to use ST7920 (`datasheet `__, `electrodragon `__) displays with ESPHome. Note that this component is for displays that are connected via the 3-Wire :ref:`SPI bus `. It's a monochrome LCD graphic display. .. figure:: images/st7920-full.jpg :align: center :width: 75.0% ST7920 LCD Graphic Display Connect D5 to the E pin you chose for the :ref:`SPI bus `, connect D7 to the R/W pin and ``RS`` to some GPIO pins on the ESP. For SPI communication it's important to connect PSB on the LCD to GND. .. code-block:: yaml # Example configuration entry spi: clk_pin: D5 mosi_pin: D7 display: - platform: st7920 cs_pin: number: 4 inverted: true lambda: |- it.print(0, 0, id(font), "Hello World!"); Configuration variables: ************************ - **cs_pin** (**Required**, :ref:`Pin Schema `): Sometimes also called ``RS``. For ST7920 should be inverted. - **width** (**Required**, int): The "width" of a screen. Defaults to 128. - **height** (**Required**, int): The "height" of a screen. Defaults to 64; - **rotation** (*Optional*): Set the rotation of the display. Everything you draw in ``lambda:`` will be rotated by this option. One of ``0°`` (default), ``90°``, ``180°``, ``270°``. - **lambda** (*Optional*, :ref:`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 ``60s``. - **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. See Also -------- - :doc:`index` - :apiref:`st7920/st7920.h` - :ghedit:`Edit`