EasyManua.ls Logo

Keyestudio ESP32 - Page 160

Keyestudio ESP32
344 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
ESP32 Starter Kit
Code
/*
keyestudio ESP32 Inventor Learning Kit
Project 29.2 IR Remote Control
http://www.keyestudio.com
*/
#include <Arduino.h>
#include <IRremoteESP8266.h>
#include <IRrecv.h>
#include <IRutils.h>
int led = 25;
int led_val = 0;
const uint16_t recvPin = 19; // Infrared receiving pin
IRrecv irrecv(recvPin); // Create a class object used to receive class
decode_results results; // Create a decoding results class object
long ir_rec;
void setup() {
Serial.begin(9600); // Initialize the serial port and set the baud rate to 9600
irrecv.enableIRIn(); // start receiving signals
pinMode(led, OUTPUT);
}
(continues on next page)
156 Chapter 8. Arduino Tutorial

Table of Contents