#include <IRremote.h>
const int RECV_PIN = 0; // IR receiver connected to PB0
const int LED_PIN = 1; // LED connected to PB1
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup() {
pinMode(LED_PIN, OUTPUT);
irrecv.enableIRIn(); // Start the receiver
}
void loop() {
if (irrecv.decode(&results)) {
if (results.value == 0xFF10EF) { // Replace with your remote's button code
digitalWrite(LED_PIN, !digitalRead(LED_PIN)); // Toggle LED
}
irrecv.resume(); // Receive the next value
}
}