Loading
Loading
IoT Lab content is currently available in Arabic only. We're working on an English version.
عرض بالعربية →Control your projects using an old TV remote.
The IR receiver has 3 legs: VCC, GND, and Signal. Connect the Signal leg to any digital pin.
#include <IRremote.h>
const int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup() {
Serial.begin(9600);
irrecv.enableIRIn();
}
void loop() {
if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);
irrecv.resume();
}
}Direct sunlight or strong fluorescent lights emit infrared rays that can interfere with the sensor and prevent it from responding.