First Project ESP32 development using the TTGO T-DISPLAY

Описание к видео First Project ESP32 development using the TTGO T-DISPLAY

Code posted at:
https://technocoma.blogspot.com/p/dht...


Continuing from our last video on this topic on getting started with the ESP32 with the TTGO-T-Display, the first project will use a DHT22 sensor along with the existing screen and buttons on the unit. Firstly, I soldered the header pins onto the board before anything so it could be affixed to a breadboard. This allowed everything to be setup on the board.



We add one new library for ADAfruit Unified Sensor which I feel isn't necessarily needed, but may cause issues for some folks, and you may need it down the road. also, DHT sensor library, also from Adafruit.


Using the library documentation, we start with a simple program to get the sensor up and running to provide some sort of serial output. As we see the output working fine, we build upon this, adding the display functionality.


Simple output of hello world shows the color and font that is desired for what we want to do. This leads to some paper and pen design. Once established, its worked into code through trial and error in some cases until the desired result is achieved. Once dynamic values are added, we need a refresh, so screen blanking is employed. Its not the best method, but it keeps the project simple.



Building on this, new parameters are added to allow for the output to be Fahrenheit or Celsius. This is Boolean. Once incorporated we will need one of the buttons to change this value. The GPIO for the built in buttons are 35 and 0. For simplicity's sake we use interrupts for the buttons, since the work required in the interrupt is minuscule, its no big deal.


And while the interrupts are working, we see a bounce issue as expected and we will have to write in debounce filters into the code to stop this problem. 200millisecond filters seem to do the trick on this device. Once debounce is solved for, the boolean value change is tied to one of the buttons allowing for a change from F to C.


Now well create functionality for the next button for a heat index display. As the device will default to the screen we created we will design another screen and show a second screen based on a second boolean value controlled by button 2.


#esp32 #iot #arduino #maker

Комментарии

Информация по комментариям в разработке