Cash Bounty for IRRemote IRrecv Port! :) [SOLVED]

There have been several posts here over the past two years requesting an IR library for receiving/decoding IR signals. Speaking personally, I have a product that is fully ported from Teensy to Photon with the exception of the IR remote functionality.

I know it’s not much, but I’m willing to PayPal $100 in beverage money immediately to the first person to port the IRrecv portion of the IRRemote library (IRsend is already ported).

Half-ported Particle library:

Original Library:

Please, would one of you godly, elite, low level types step in here and do us tinkerers a solid? This would be a powerful and long overdue library to have in the Particle arsenal.


What do you mean with half-ported library?

He only ported the IRsend half of the library and omitted IRrecv.

You would need the receiving/decoding part of the Arduino library?

That is correct. See the title of my post. :smile:

Any interest or suggestions? I spoke with @Moors7 at Maker Faire and he was optimistic that some hero out there might be willing to heed the call.

1 Like

@Jerware, I’ll have a look to assess feasibility :wink:


That would be the guy up above :point_up:

1 Like

@Jerware, I think I have an approach for porting the entire library using SparkIntervalTimer and the variable frequency PWM capability of the recent firmware. Stay tuned.

1 Like

@peekay123 Exciting! I will most definitely stay tuned.

I have no way of testing this… but would be nice to know if you can try it.


@mdoan7 It compiles, but when I press a button on my IR remote there is a ~5 second delay and then this is printed to the terminal:

Attempting NEC decode
Testing mark 50 vs 9000: 136 <= 1 <= 228
Attempting Sony decode
Attempting Sanyo decode
Attempting Mitsubishi decode
Attempting RC5 decode
Attempting RC6 decode
Testing mark 50 vs 2666: 41 <= 1 <= 70
Attempting Panasonic decode
Testing mark 50 vs 3502: 54 <= 1 <= 91
Attempting JVC decode
Testing mark 50 vs 8000: 121 <= 1 <= 203

These prints come from the library. If a signal is properly decoded, it doesn’t continue checking. Thank you for the port attempt though! Any idea what’s causing the delay and decode failure?

@Jerware, @mdoan7 used a Software Timer for sampling the IR input signal. The timer is supposed to fire at 50us intervals. However, Software Timers have a minimum 1ms accuracy so timing will be off.

The port requires a hardware timer implementation and thus why I suggested SparkIntervalTimer. His implementation of the variable frequency PWM for code output looks good though I don’t believe using the Atmel method for turning on and off the PWM output will work as expected. I’ll be working on the library over the weekend. :wink:

1 Like

@peekay123, I’ve been playing with SparkIntervalTimer on another project so swapped it in here.
@Jerware, give it a spin. I’m doing this for my own education so it’s a hack. @peekay123 will definitely be the one to use for production.


@Jerware, you’ve done a great job! I’ll be putting it up on the IDE so I’ll be using more conditional compiling and a bit more inline doc.

@mdoan7 Obviously @peekay123 meant to give you kudos, not me! I just tried your latest commit and it works! I’m overjoyed, thank you. The only thing I can’t figure out is how to turn off the debug prints. They’re only supposed to print if DEBUG is defined, and I can’t find a single instance of it being defined anywhere in the sketch or library. Any ideas?

PM me your paypal and I’ll deliver the bounty, as promised.

1 Like

In IRremote.cpp, there is a lot of Serial.print() and Serial.Println() I silenced them all by doing a replace all of Serial.print to // Serial.print

@Jerware, you are correct! I’ll use @mdoan7 work, add some spit and polish, fix the DEBUG flag thing and prepare everything for publishing on the IDE. Good work @mdoan7 :wink:

1 Like

Thanks @mdoan7 for porting this library! It works great on my Photon.


@peekay123, thanks. You were the motivation…err… inspiration. :smile:
@nrobinson2000 Cool. Mental sims are cool but now I have to get me an IR to play with this myself!
@Jerware, debug… try now.