ArduinoIR remote library modification to include interrupt

Just a quick update today, messing with a little project and I did a performance test on the ArduinoIR library, it is very slow taking 2ms to poll the IR pin so I figured why not just include an interrupt and trigger the polling of the pin using the pin! simple fix and removes the 2ms lagg from the program loop while avoiding missing any button presses!

of course you will need the ArduinoIR library to do this. You can get it here.
The below will output the IR code HEX to your serial pin. It’s basic but does the job without holding up the program loop!

#include <IRremote.h>

int RECV_PIN = 2;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
  irrecv.enableIRIn(); // Start the receiver


void loop() {

void CHECK_IR(){
  Serial.println(results.value, HEX);


Tags: , , , ,

One Response to “ArduinoIR remote library modification to include interrupt”