EasyManuals Logo

SunFounder ESP32 User Manual

Default Icon
771 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #407 background image
SunFounder ESP32 Starter Kit
(continued from previous page)
humi = sensor.humidity()
# Print temperature and humidity
print("Temperature: {}, Humidity: {}".format(temp, humi))
# Wait for 1 second between measurements
time.sleep(1)
except Exception as e:
print("Error: ", e)
time.sleep(1)
When the code is running, you will see the Shell continuously print out the temperature and humidity, and as the
program runs steadily, these two values will become more and more accurate.
Learn More
You can also display the temperature and humidity on the I2C LCD1602.
Note:
Open the 5.13_dht11_lcd.py file located in the esp32-starter-kit-main\micropython\codes path, or
copy and paste the code into Thonny. Then, click “Run Current Script” or press F5 to execute it.
Make sure to select the “MicroPython (ESP32).COMxx” interpreter in the bottom right corner.
3.31. 5.13 Temperature - Humidity 401

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the SunFounder ESP32 and is the answer not in the manual?

SunFounder ESP32 Specifications

General IconGeneral
BrandSunFounder
ModelESP32
CategoryController
LanguageEnglish