From 31853d1af5233ec22a93565c9ab7e03f8ba0e773 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=2E=20=C3=81rkosi=20R=C3=B3bert?= Date: Fri, 18 Nov 2022 09:19:55 +0100 Subject: [PATCH 1/2] Fix of typos again --- components/display/lcd_display.rst | 43 +++++++++++++++--------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/components/display/lcd_display.rst b/components/display/lcd_display.rst index 94baf6852..0c01400a9 100644 --- a/components/display/lcd_display.rst +++ b/components/display/lcd_display.rst @@ -2,12 +2,16 @@ Character-Based LCD Display =========================== .. seo:: - :description: Instructions for setting up character-based LCD displays. + :description: Instructions for setting up character-based HD44780 LCD displays. :image: lcd.jpg The ``lcd_pcf8574`` and ``lcd_gpio`` display components allow you to use HD44780-compatible, character-based LCD displays with ESPHome. This integration is only for LCD displays that display individual characters on a screen -(usually 16-20 columns and 2-4 rows), and not for LCD displays that can control each pixel individually. +(usually 8-40 columns and 2-4 rows), and not for LCD displays that can control each pixel individually. + +.. figure:: images/lcd-hello_world.jpg + :align: center + :width: 60.0% .. note:: @@ -32,11 +36,7 @@ The communication happens via :ref:`I²C Bus `, you need to have an ``i2c:` :align: center :width: 75.0% - The PCF8574 chip attached to the LCD Display - -.. figure:: images/lcd-hello_world.jpg - :align: center - :width: 60.0% + LCD Display with a PCF8574 board attached on the back .. code-block:: yaml @@ -65,7 +65,7 @@ Configuration variables: .. note:: - If you're not seeing anything on the display, make sure you try turning the contrast potentiometer around on the + If you're not seeing anything on the display, try turning the contrast potentiometer around on the PCF8574 board. .. _lcd-gpio: @@ -73,9 +73,9 @@ Configuration variables: lcd_gpio Component ------------------ -The ``lcd_gpio`` version of this component addresses the screen directly and does not employ a PCF8574 module. +The ``lcd_gpio`` version of this component addresses the screen directly and does not employ a GPIO expander module. Each of the data pins of the LCD needs a dedicated GPIO pin on the ESP. Connecting the screen this way offers -faster refresh, especially in conjunction with an :ref:`LCD menu `. +faster refresh, especially in conjunction with an :ref:`LCD Menu `. .. figure:: images/lcd_gpio.svg :align: center @@ -103,15 +103,14 @@ Configuration variables: ************************ - **dimensions** (**Required**, string): The dimensions of the display with ``COLUMNSxROWS``. If you're not - sure, power the display up and just count them. -- **data_pins** (**Required**, list of :ref:`Pin Schemas `): A list of the data pins you - have hooked up to the LCD. The list can either be 8 items long (when you have connected all 8 data pins), or - 4 items long (if you're operating in 4-bit mode with either the first 4 data pins connected or the last 4 data + sure, power the display on, turn contrast high up and just count them. +- **data_pins** (**Required**, list of :ref:`pins `): A list of the data pins you + have hooked up to the LCD. The list can either be 4 items long (when you have connected all 8 data pins), or + 8 items long (if you're operating in 4-bit mode with either the first 4 data pins connected or the last 4 data pins connected). -- **enable_pin** (**Required**, :ref:`Pin Schema `): The pin you have ``EN`` hooked up to. -- **rs_pin** (**Required**, :ref:`Pin Schema `): The pin you have ``RS`` hooked up to. -- **rw_pin** (*Optional*, :ref:`Pin Schema `): Optionally set the pin you have ``RW`` hooked up to. - You can also just permanently connect that pin to GND. +- **enable_pin** (**Required**, :ref:`pin `): The pin you have ``E`` (``06``) hooked up to. +- **rs_pin** (**Required**, :ref:`pin `): The pin you have ``RS`` (``04``) hooked up to. +- **rw_pin** (*Optional*, :ref:`pin `): Optionally set the pin you have ``R/W`` (``05``) hooked up to. You can also just permanently connect that pin to ``GND``. - **lambda** (*Optional*, :ref:`lambda `): The lambda to use for rendering the content on the display. See :ref:`display-lcd_lambda` for more information. - **update_interval** (*Optional*, :ref:`config-time`): The interval to re-draw the screen. Defaults to ``1s``. @@ -119,7 +118,7 @@ Configuration variables: .. note:: - If you're not seeing anything on the display, make sure you apply ``3.3V`` to the ``03`` (``VEE``) contrast control + If you're not seeing anything on the display, make sure you apply ``3.3V`` to the ``VEE`` (``03``) contrast control pin of the board. You can use a potentiometer to make it adjustable. @@ -153,7 +152,7 @@ by default which means the character at the top left. // Let's write a sensor value (let's assume it's 42.1) it.printf("%.1f", id(my_sensor).state); - // Result: "42.1" (the dot will appear on the "2" segment) + // Result: "42.1" (the dot will appear on the segment showing "2") // Print a right-padded sensor value with 0 digits after the decimal it.printf("Sensor value: %8.0f", id(my_sensor).state); @@ -165,7 +164,7 @@ by default which means the character at the top left. # (Optional) For displaying time: time: - - platform: sntp + - platform: homeassistant id: my_time Please see :ref:`display-printf` for a quick introduction into the ``printf`` formatting rules and @@ -221,7 +220,7 @@ display lambda definition. The jumper on the PCF8574 board needs to be closed fo Keep in mind that the display lambda runs for every ``update_interval``, so if the backlight is turned on/off there, it cannot be overridden from other parts. -With the ``lcd_gpio``, the backlight is lit by applying ``Vcc`` to the ``15`` (``BLA``) pin and connect ``16`` (``BLK``) +With the ``lcd_gpio``, the backlight is lit by applying ``Vcc`` to the ``BLA`` (``15``) pin and connect ``BLK`` (``16``) pin to ``GND``. The backlight can draw more power than the microcontroller output pins can supply, so it is advisable to use a transistor as a switch to control the power for the backlight pins. From d06a2a3aabd2d8cd7112436b54c90e71fd051d35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=2E=20=C3=81rkosi=20R=C3=B3bert?= Date: Fri, 18 Nov 2022 09:27:15 +0100 Subject: [PATCH 2/2] Update lcd_display.rst --- components/display/lcd_display.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/display/lcd_display.rst b/components/display/lcd_display.rst index 0c01400a9..8527c9b39 100644 --- a/components/display/lcd_display.rst +++ b/components/display/lcd_display.rst @@ -105,9 +105,9 @@ Configuration variables: - **dimensions** (**Required**, string): The dimensions of the display with ``COLUMNSxROWS``. If you're not sure, power the display on, turn contrast high up and just count them. - **data_pins** (**Required**, list of :ref:`pins `): A list of the data pins you - have hooked up to the LCD. The list can either be 4 items long (when you have connected all 8 data pins), or - 8 items long (if you're operating in 4-bit mode with either the first 4 data pins connected or the last 4 data - pins connected). + have hooked up to the LCD. The list can either be 4 items long (operating in 4-bit mode with + either the first 4 data pins connected or the last 4 data pins connected), or 8 items long (when you have + connected all 8 data pins). - **enable_pin** (**Required**, :ref:`pin `): The pin you have ``E`` (``06``) hooked up to. - **rs_pin** (**Required**, :ref:`pin `): The pin you have ``RS`` (``04``) hooked up to. - **rw_pin** (*Optional*, :ref:`pin `): Optionally set the pin you have ``R/W`` (``05``) hooked up to. You can also just permanently connect that pin to ``GND``.