I think you could really do with some kind of oscilloscope - a cheap one like the 'DSO nano' would work well, or you could even rig something up using the audio jack of your PC and some resistors/capacitors.
Assuming you are using the latest firmware (1v79) I'd be pretty sure that Espruino is doing what you tell it. On Saturday I did a Nodebots day, and someone there was using digitalPulse exactly like you have above in order to fake an IR remote signal. It worked first time.
Also, I notice you now have an even number of array elements, which will mean that the IR LED is left ON after the pulse is sent. It could explain some bad readings?
For instance:
digitalPulse(pin, 1, [A,B,C,D]);
// is the same as
digitalWrite(pin,1);
wait(A);
digitalWrite(pin,0);
wait(B);
digitalWrite(pin,1);
wait(C);
digitalWrite(pin,0);
wait(D);
digitalWrite(pin,1); // <--- leaves the IR LED on
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.
I think you could really do with some kind of oscilloscope - a cheap one like the 'DSO nano' would work well, or you could even rig something up using the audio jack of your PC and some resistors/capacitors.
Assuming you are using the latest firmware (1v79) I'd be pretty sure that Espruino is doing what you tell it. On Saturday I did a Nodebots day, and someone there was using
digitalPulse
exactly like you have above in order to fake an IR remote signal. It worked first time.Also, I notice you now have an even number of array elements, which will mean that the IR LED is left ON after the pulse is sent. It could explain some bad readings?
For instance: