• That document's description of the codes doesn't look a lot like you're getting... Still, it doesn't really matter too much - you just want to replay the exact sequence that you're receiving.

    I think the issue with your code is really just that you can't make the 39kHz square wave in software in Espruino because it's not fast enough - you have to use the hardware PWM for it.

    Take a look at this tutorial - where signals are generated for a IR remote control helicopter](http://www.espruino.com/wii_remote_contrĀ­ol_helicopter)

    You use the PWM to generate the 39kHz carrier on one pin, and then use the other pin to output the much slower data (and the LED mixes everything together). Using setTimeout for the data might work, but I'd recommend that you just use digitalPulse - which is a bit more accurate.

About

Avatar for Gordon @Gordon started