No problem - when you supply an array to digitalPulse, you're actually specifying [up_time,down_time,up_time,down_time,...], and you probably want a fixed gap between pulses, so to send 110 you probably want something like:
var gap = 0.5;
digitalPulse(A6, 1, [1,gap,1,gap,0.6]);
Note that the code checks d>0.0008, but because it's the real world the timings won't be accurate. You want to leave some leeway (maybe 0.2ms?) - so when sending a 0 maybe send 0.6 and for a 1 send 1.0.
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.
Hi Daniel,
No problem - when you supply an array to digitalPulse, you're actually specifying
[up_time,down_time,up_time,down_time,...]
, and you probably want a fixed gap between pulses, so to send110
you probably want something like:Note that the code checks
d>0.0008
, but because it's the real world the timings won't be accurate. You want to leave some leeway (maybe 0.2ms?) - so when sending a 0 maybe send0.6
and for a 1 send1.0
.