Keyestudio ESP32 Manual page 161

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

Advertisement

void
loop() {
if
(irrecv.decode(&results)) {
ir_rec
=
results.value;
if
(ir_rec
!=
0) {
button is pressed
if
(ir_rec
==
button OK
led_val
=
!led_val;
turns to 1 after reversing
digitalWrite(led, led_val);
}
}
irrecv.resume();
}
}
8.5.31 Project 30: Smart Home
1. Description
In this technology era, we are all familiar with smart home. It is a system that can control electric appliance via buttons.
In this project, we seek to stimulate a smart home via an IR remote control. With Arduino MCU as its core, it can be
used to control light, air conditioners, TV and security monitors.
8.5. Arduino Project
//assign the signal to the variable ir_rec
//Prevente the code from repeating execute when
0xFF02FD) {
//Determine whether the received IR signal is
//Reverse a variable. If the initial value is 0,
//Release the IR remote and receive the next value.
ESP32 Starter Kit
(continued from previous page)
the␣
from␣
it␣
157

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