Keyestudio ESP32 Manual page 163

Starter kit
Hide thumbs Also See for ESP32:
Table of Contents

Advertisement

3. Wiring Diagram
4. Test Code
With the IR remote control, this smart home reveals various sensor values on LCD, including a temperature and hu-
midity sensor, a sound sensor, a photoresistor, a potentiometer and an ultrasonic sensor.
/*
keyestudio ESP32 Inventor Learning Kit
Project 30 Smart Home
http://www.keyestudio.com
*/
#include
<LiquidCrystal_I2C.h>
#include
<IRremoteESP8266.h>
#include
<IRrecv.h>
#include
<IRutils.h>
#include
<xht11.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
line display
const
uint16_t
recvPin
IRrecv irrecv(recvPin);
decode_results results;
long
ir_rec;
xht11 xht(26);
unsigned char
dat[]
humidity data
8.5. Arduino Project
// set the LCD address to 0x27 for a 16 chars and
=
19;
// Infrared receiving pin
// Create a class object used to receive class
// Create a decoding results class object
//The DHT11 connects to IO26
=
{ 0, 0, 0,
0
};
//Define an array to store temperature
ESP32 Starter Kit
2␣
and␣
(continues on next page)
159

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Related Products for Keyestudio ESP32

Table of Contents

Save PDF