Great! Thanks for the update.
To output the bit lengths, use:
digitalPulse(myPin, 0, timeToLowerPulseFor); digitalPulse(myPin, 1, timeToRaisePulseFor); digitalPulse(myPin, 0, timeToLowerPulseFor); digitalPulse(myPin, 1, timeToRaisePulseFor); ...
digitalPulse does some magic with interrupts that makes it much more accurate for a short series pulses than setTimeout would be.
@Gordon started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Great! Thanks for the update.
To output the bit lengths, use:
digitalPulse does some magic with interrupts that makes it much more accurate for a short series pulses than setTimeout would be.