To transmit an IR signal, you just need to call Puck.IR([...]) with an array of times in milliseconds. They alternate between the time the signal should be on and off - eg. [on, off, on, off, on, etc].
For example the command to turn on a cheap IR lightbulb is:"
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.
Wed 2017.08.02
I wish to send a slow pulse train via the onboard IR diode, say [500ms on, 500ms off] repeat three times.
From page: http://www.espruino.com/Puck.js#ir-infrared
"IR / Infrared
To transmit an IR signal, you just need to call Puck.IR([...]) with an array of times in milliseconds. They alternate between the time the signal should be on and off - eg. [on, off, on, off, on, etc].
For example the command to turn on a cheap IR lightbulb is:"
From page: http://www.espruino.com/Reference#l_Puck_IR
Parameters: 'data - An array of pulse lengths, in milliseconds'
The declaration is missing some detail.
Q1: What is the range (width) in msec that each pulse may be? For instance min 0.5msec max 500msec
Q2: Does the array have to specify an exact count 'n' (on, off) cycles? For instance 'n' must equal 20
Q3: Does the tutorial at '(a tutorial on this will be added soon)' exist?
Sidebar:
The link at 'For example the command to turn on a cheap IR lightbulb is:' produces a 404 error
Thank you for your input,
Robin