Avatar for rchateauneu

rchateauneu

Member since Nov 2022 • Last active Feb 2023
  • 4 conversations
  • 11 comments

I am Rémi, and live in London.

Most recent activity

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

    As kindly suggested, I tried a DFU reset with "Cutting Edge build: espruino_2v16.93_pixljs.zip"
    I attached the Android displays, after the sequence:

    DFU 2V16
    RELEASE BTN1 FOR DFU
    BTN1 TO BOOT
    <=============      >
    

    ... then pressing BTN1 gives:

    DFU START
    

    Please that it does NOT display this, the end after "START" is missing:
    DFU STARTED READY TO UPDATE

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

    Please find attached the whole script and the image.

    Also: I did not save this program to flash memory, so maybe the hardware is broken ?

    I will flash the latest firmware and will tell the result.

    Thanks

    Remi

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

    After having uploaded a big splash image with require("Storage").write(".splash",E.toA­rrayBuffer(atob("
    my Pixl is frozen.

    So I do a hard-reset, power off/on with BTN1 pressed. It starts, then displays:

    DFV 2V16
    RELEASE BTN1 FOR DEV
    BTN1 TO BOOT
    
    <==================================>
    BOOTING...
    

    Then the led flashes once, and the screen is frozen with the same message.

    Possible reason: a JSA connector I soldered two weeks ago, but it was working OK after that.

    I am happy to try to flash the memory myself.

  • Avatar for rchateauneu

    Thanks for your answer.
    The problem happens when setting a watch on BTN1 to call a function opening the menu. Then, changing the watches to the proper buttons used by the menu.
    At this moment, BTN1 and BTN4 work in the opposite way (BTN1 is down amd BTN4 is up), and it is not possible anymore to edit the value of a number.

    However, if I use BTN2, and do not clearWatch BTN1,3,4 , it works fine.

    Therefore, I "overwrote the Pixl's default showMenu implementation", and it worked perfectly.

    So, I suspect some sort of conflict when changing a watch once the menu is created. Like:
    m.setWatch() , returned_copy_of_m.clearWatch(), returned_copy_of_m.setWatch() after menu creation.
    Maybe, setting the second watch with a copy of the variable m ?

    Anyway, it works fine now, so thanks again.

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

    I have created a menu on a Pixl, and this is normally controlled with the small buttons on the card.

    I would like, instead, to control this menu with external buttons connected to D1 ... D4.

    To understand what the internal events handlers of the menu really do, I tried to replace the setWatch calls by the suggestions of the link Graphical Menu:

    setWatch(function() {
      m.move(-1); // up
    }, BTN1, {repeat:true,debounce:50,edge:"rising"})­;
    
    setWatch(function() {
      m.move(1); // down
    }, BTN4, {repeat:true,debounce:50,edge:"rising"})­;
    
    setWatch(function() {
      m.select(); // select
    }, BTN3, {repeat:true,debounce:50,edge:"rising"})­;
    

    It works for a simple menu, but not for editing the value of a number, for example.

    So the questions are:

    1. Is it possible to reuse the event handlers of the menu (up/down etc...) and call them from another type of event ? (D1 ...)
    2. Or is there another way to use a menu with different events ?

    Many thanks in advance.

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

    This Pixl program advertises a service, treats "onWrite" queries, and write the received character in a loop, every second:

    var eventData = "NOTHING";
    
    NRF.setServices({
      0xEDCB : {
        0xBA98 : {
          description: "MyCharact",
          writable  : true,
          onWrite : function(evt) {
            eventData = evt.data;
          }
        }
      }
    },
    { advertise: [ 'EDCB' ]});
    
    var counter = 0;
    
    function intervalHandler()
    {
      console.log("counter: " + counter + " Data=" + eventData);
      counter++;
    }
    
    setInterval(intervalHandler, 1000);
    
    g.clear();
    g.flip();
    LED.set();
    
    NRF.on('connect', function(addr) {
      console.log("Connection. addr=", addr);
    });
    
    NRF.on('disconnect', function(reason) {
      console.log("reason=" + reason);
    });
    

    Apparently, it can receive only one character. When sending byte arrays of more than one byte with nRF Connect or BLEScanner, nothing happens. However, when sending one byte only, it is received and correctly displayed.

    What do you think, please ?

Actions