Вернуться на страницу библиотеки модулей
#include <IRremote.hpp> // IRremote v4.x
const int RECV_PIN = 11; // KY-022 signal pin (S)
void setup() {
Serial.begin(9600);
IrReceiver.begin(RECV_PIN, ENABLE_LED_FEEDBACK);
Serial.println(F("Point a remote at the KY-022 and press a button:"));
}
void loop() {
if (IrReceiver.decode()) {
IrReceiver.printIRResultShort(&Serial); // protocol, address, command and raw value
IrReceiver.resume(); // ready for the next button
}
}
Рекомендованные ссылки:
KY-022 Infrared receiver – SensorKit
Arduino IR Receiver Module KY-022 (HW-490) — Pinout, Wiring & Code
Sensor Wiki: KY-022 Infrared Sensor – The Geek Pub
ESP32 KY-022 Infrared Receiver Module Pinout & Datasheet

