Avatar for user67655

user67655

Member since Sep 2016 • Last active Jul 2020
  • 2 conversations
  • 7 comments

Most recent activity

  • in Puck.js, Pixl.js and MDBT42
    Avatar for user67655

    I just found: if I re-insert the batteries after the 4) step above (without re-loading the codes), then everything work correctly. So I think it's not a problem anymore.
    Thanks!

  • in Puck.js, Pixl.js and MDBT42
    Avatar for user67655

    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 battery

    What could be the problem here?

  • in Puck.js, Pixl.js and MDBT42
    Avatar for user67655

    Thank you Gordon, it's working now!
    I think the require("ble_simple_uart")" on WEB IDE via "Send to Espruino" was not correctly executed - it runs now fine.

  • Avatar for user67655

    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();
    
  • Avatar for user67655

    I have the pucks named "c123" (master), and "ae23" (slave).
    I followed the description at https://www.espruino.com/Puck.js+Control­ling+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 nothing

    What do I do wrong?
    Thanks for the answer!

  • in Puck.js, Pixl.js and MDBT42
    Avatar for user67655

    Hi,
    I have a PuckJS 2 with 2v06 and a PN532 NFC v3 module from Elechouse, connected as follows:

    Puck.js_D28 to PN532_SCL,
    Puck.js_D29 to PN532_SDA,
    Puck.js_3V to PN532_VCC,
    Puck.js_GND to PN532_GND,

    Puck.js works fine and the red LED on the PN532 is also active.
    Actually I use the Espruino Web Ide Tool, so:
    1) I wrote the require("PN532"); on the right side;
    2) sent with "Send to Espruino button" - the loading was OK (screen refreshed);
    3) I tried to run it as described in the example for PN532 ( scl:B6 and sda:B6 changed to D28 and D29 );

    I see now the following on the web console:
    ...
    ...
    2v06 (c) 2019 G.Williams

    I2C1.setup({scl:28, sda:29});
    =undefined
    var nfc = require("PN532").connect(I2C1);
    ={
    i2c: I2C1
    }
    print(nfc.getVersion());
    Uncaught InternalError: I2C Write Error 33281
    at line 1 col 172
    ...sh(0);this.i2c.writeTo(36,b);b=this.i­2c.readFrom(36,6);b[4]&...

                              ^
    

    in function "cmd" called from line 1 col 22
    var a=this.cmd([2],12);return{chip:"PN5"+a[2­].toString(16),f...

                     ^
    

    in function "getVersion" called from line 1 col 22
    print(nfc.getVersion());

                     ^
    

    ...
    ...

    Can somebody help me, what could be the problem?
    Thank you!

Actions