-
• #2
I have planned to have it connected to homebridge and controll my fans, automatically turn on the fans when the room gets to hot. But also able to command it by Siri
-
• #3
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.
-
• #5
Ahh, right. Sorry, I think you fell foul of a bug I introduced while trying to support Puck.js v2 with the same firmware: https://github.com/espruino/Espruino/blob/master/ChangeLog#L11
Puck.js v1: Fix regression that stopped Puck.IR(data) working - Puck.IR(data,D26,D25) required
So I think if you add
D26,D25
to the end of the call it'll start working - or if you install a 'cutting edge' build it'll be fine.I'm planning to release a version 2v06 very soon which should have that (and a few other) fixes in though.
-
• #9
Glad it's going ok! With 2v05 and later you might have some success increasing range of the external LED by just specifying a single IO pin and connecting the other pin of the LED to GND.
The on-puck LED should do better than 10cm though - it is reasonably directional without the cover though, so it helps if it's pointing towards the thing you're interested in controlling.
Hello im trying to send a signal from my puckjs with an external ir led to a remote controlled fan. I tried the tutorial with capturing data from the remote control and got some values to my ir receiver . I tried the ordinary built in IR but it did not work i tried to capture the signal with another puck but it sends no signal. I have attached my code. What pins should i use for the ir led? i have used d30 and d31.
Any ideas?
2 Attachments