Hi! What firmware is on your Puck.js, and which version Puck is it?
This seems like something you should be able to do pretty easily and your code looks fine. Do you see anything appear on the second Puck if you paste in Puck.IR([1.3,0.4,1.3,0.4,0.4,1.2,1.3,0.4,1.3,0.4,0.5,1.2,0.4,1.2,0.4,1.2,0.5,1.2,1.3,0.4,0.5,1.2,0.5,7.9,1.3,0.4,1.3,0.4,0.5,1.2,1.3,0.4,1.3,0.4,0.4,1.2,0.5,1.2,0.5,1.2,0.5,1.2,1.3,0.4,0.4,1.2,0.5,7.9,1.3,0.4,1.3,0.4,0.5,1.2,1.3,0.4,1.3,0.4,0.4,1.2,0.5,1.2,0.5,1.2,0.4,1.2,1.3,0.4,0.4,1.2,0.5,7.9,1.3,0.4,1.3,0.4,0.5,1.2,1.3,0.4,1.3,0.4,0.4,1.2,0.5,1.2,0.5,1.2,0.4,1.2,1.3,0.4,0.4,1.2,0.5,7.8,1.3,0.4,1.3,0.4,0.5,1.2,1.3,0.4,1.3,0.4,0.5,1.2,0.5,1.2,0.4,1.2,0.5,1.2,1.3,0.4,0.4,1.2,0.5,7.9,1.3,0.4,1.3,0.4,0.4,1.3,1.3,0.4,1.3,0.4,0.5,1.2,0.4,1.3,0.4,1.2,0.4,1.3,1.2,0.4,0.4,1.3,0.4,7.9,1.3,0.4,1.3,0.4,0.4,1.3,1.3,0.4,1.3,0.4,0.4,1.2,0.4,1.3,0.4,1.2,0.4,1.2,1.3,0.4,0.4,1.2,0.4,7.9,1.3,0.4,1.3,0.4,0.4,1.3,1.3,0.4,1.3,0.4,0.5,1.2,0.4,1.3,0.4,1.2,0.4,1.3,1.3,0.4,0.5,1.2,0.4]) in the IDE?
Using an external IR LED should be fine though... You'll just have to specify the pins with Puck.IR(data, D30,D31) (and maybe swap D30/D31 if it doesn't work first time).
Or, the code that's in your HTML:
// Start the 38kHz square wave
analogWrite(A5,0.9,{freq:38000});
// Send the pulses
digitalPulse(A6, 1, times);
// Wait until pulsing is finished
digitalPulse(A6, 1, 0);
Should work fine too - you just have to change A5/A6 for D30/D31.
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! What firmware is on your Puck.js, and which version Puck is it?
This seems like something you should be able to do pretty easily and your code looks fine. Do you see anything appear on the second Puck if you paste in
Puck.IR([1.3,0.4,1.3,0.4,0.4,1.2,1.3,0.4,1.3,0.4,0.5,1.2,0.4,1.2,0.4,1.2,0.5,1.2,1.3,0.4,0.5,1.2,0.5,7.9,1.3,0.4,1.3,0.4,0.5,1.2,1.3,0.4,1.3,0.4,0.4,1.2,0.5,1.2,0.5,1.2,0.5,1.2,1.3,0.4,0.4,1.2,0.5,7.9,1.3,0.4,1.3,0.4,0.5,1.2,1.3,0.4,1.3,0.4,0.4,1.2,0.5,1.2,0.5,1.2,0.4,1.2,1.3,0.4,0.4,1.2,0.5,7.9,1.3,0.4,1.3,0.4,0.5,1.2,1.3,0.4,1.3,0.4,0.4,1.2,0.5,1.2,0.5,1.2,0.4,1.2,1.3,0.4,0.4,1.2,0.5,7.8,1.3,0.4,1.3,0.4,0.5,1.2,1.3,0.4,1.3,0.4,0.5,1.2,0.5,1.2,0.4,1.2,0.5,1.2,1.3,0.4,0.4,1.2,0.5,7.9,1.3,0.4,1.3,0.4,0.4,1.3,1.3,0.4,1.3,0.4,0.5,1.2,0.4,1.3,0.4,1.2,0.4,1.3,1.2,0.4,0.4,1.3,0.4,7.9,1.3,0.4,1.3,0.4,0.4,1.3,1.3,0.4,1.3,0.4,0.4,1.2,0.4,1.3,0.4,1.2,0.4,1.2,1.3,0.4,0.4,1.2,0.4,7.9,1.3,0.4,1.3,0.4,0.4,1.3,1.3,0.4,1.3,0.4,0.5,1.2,0.4,1.3,0.4,1.2,0.4,1.3,1.3,0.4,0.5,1.2,0.4])
in the IDE?Using an external IR LED should be fine though... You'll just have to specify the pins with
Puck.IR(data, D30,D31)
(and maybe swap D30/D31 if it doesn't work first time).Or, the code that's in your HTML:
Should work fine too - you just have to change A5/A6 for D30/D31.