@Infinity see the post below for a hardware PWM hack.
Unfortunately, it makes use of the Tx pin, which may be an issue for you.
We have finally found an easy way to get Hardware PWM for Infrared signals using the Photon, using the UART hack below.
It may also be of use to others looking for faster PWM and variable duty cycles at 10% intervals.
The full source code and IR driver circuit are availabe via the link above or via http://www.AnalysIR.com/
PS: This should also work on Spark & other fast MCUs, if needed. (untested)
.[image]
We made an earlier post showing how to generate softPWM, which would work for short bursts, but probably not for continuous PWM. (Follow link in this post)
I’ll start a new project thread when I have something more interesting but I can verify your IR sending code works on a Spark Core without any modifications.
Here is the start of my project: https://github.com/edalquist/ac_ir_control
The IR recorder code is directly from your blog.
The IR sending code is slightly modified with some extra debugging and a safety check for bad IR code data.
With those I managed to capture the on/off button from the remote with an Arduino Uno and then replay tha…