Most recent activity
-
- 5 comments
- 1,409 views
-
-
-
- 7 comments
- 1,831 views
-
I tried now also the 2nd example ( at "Making it faster" ):
Here I have the following problem:
1) I press the button on master-puck, the green LED lights; now the red LED lights also on the slave-puck(this is OK);
2) if I press the master-puck again, the red LED is OFF on slave-puck (this is OK also);
3) I play this 3 times (on and off)
4) After the 7. button press on master-puck, the green LED is always lights on master-puck, but the slave-puck do nothing. Only if I make a reset() and a new load/code copie to the master can I run this procedure again.
5) .. and I cannot connect anymore to my slave-puck via WEB IDE, I must remove/put in again the batteryWhat could be the problem here?
-
-
oh, sorry, my copy/paste was wrong here :-(
here is the test what I made, and I have the problem in this version://=========================================================================================================================================== Slave: var on = 0; function toggle() { on = !on; digitalWrite(LED, on); } --> save(); //=========================================================================================================================================== Master: // Are we busy? var busy = false; // Function to call 'toggle' on the other Puck function sendToggle() { if (!busy) { busy = true; digitalPulse(LED3, 1, 500); // light blue to show we're working NRF.requestDevice({ filters: [{ name: 'Puck.js ae23' }] }).then(function(device) { require("ble_simple_uart").write(device, "toggle()\n", function() { digitalPulse(LED2, 1, 500); // light green to show it worked busy = false; }); }).catch(function() { digitalPulse(LED1, 1, 500); // light red if we had a problem busy = false; }); } } // Call sendToggle when the button is pressed setWatch(sendToggle, BTN, { edge:"rising", debounce:50, repeat: true }); --> save();
-
I have the pucks named "c123" (master), and "ae23" (slave).
I followed the description at https://www.espruino.com/Puck.js+Controlling+Other+Pucks
1) slave: code copied to puck named "ae23" and save()
2) master: puck name changed to "...filters: [{ name: 'Puck.js c123'..." , code copied and save()Testing with and without loading "require("ble_simple_uart")" on WEB IDE via "Send to Espruino"
The result is always
a) master: the blue LED is on (OK), then the red LED is on (KO)
b) slave does nothingWhat do I do wrong?
Thanks for the answer! -
Thanks a lot for your answers @allObjects and @Gordon !
I have Puck.js v2, so I think the on-board FET will be a great solution for me.
Thank you!