# Choisir les GPIO ESP32

**URL:** <https://forum.hacf.fr/t/choisir-les-gpio-esp32/18305>\
**Category:** Entraide Home Assistant\
**Tags:** esphome, esp32\
**Created:** [Décembre 12, 2022, 7:46 UTC](https://forum.hacf.fr/t/choisir-les-gpio-esp32/18305 "2022-12-12T19:46:32Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Bob](https://forum.hacf.fr/user_avatar/forum.hacf.fr/bob/32/64908_2.png) [@Bob](https://forum.hacf.fr/u/Bob)\
**Post date:** [Décembre 14, 2022, 12:38 UTC](https://forum.hacf.fr/t/choisir-les-gpio-esp32/18305/7 "2022-12-14T12:38:17Z")

</div>

Je n’ai pas pu attendre 😉

J’ai ajouté au yaml de l’ESP32 qui pilote l’écran un sensor de HA :

```auto
sensor:
  - platform: ultrasonic
    trigger_pin: GPIO13
    echo_pin: GPIO12
    name: "Ultrasonic Sensor"
    update_interval: 1s
    id: sensor_ultrasonic

  - platform: homeassistant
    id: current_temperature
    entity_id: sensor.psalon_temperature

```

Dans le display: mes deux capteurs, nickel @AlexHass

```auto
      - id: page5
        lambda: |-
          it.rectangle(0, 0, it.get_width(), it.get_height());
          it.print(3, 36, id(my_font18), my_red, TextAlign::LEFT, "Is a good day ");
          it.printf(1, 120, id(my_font18), "Distance : %.1f M", id(sensor_ultrasonic).state);
          it.printf(1, 140, id(my_font18), "Temp : %.1f °C", id(current_temperature).state);

```

Affichage OK  
Merci

Bob

---

_[View the full topic](https://forum.hacf.fr/t/choisir-les-gpio-esp32/18305)._
