You are reading a single comment by @coat and its replies. Click here to read the full conversation.
  • Hi everyone.
    I'm new here and I would learn to program my microbit v2 with espruino.
    So, I've connect my board to Espruino Web IDE. So far so good.
    But when I try the examples here it seems that they doesn't work.

    For example, I have flash on micro:bit this one

    show("1   1\n"+
         "  1  \n"+
         "  1  \n"+
         "1   1\n"+
         " 111 \n");
    

    but nothing happens.

    Then I have try with the following one

    g = Graphics.createArrayBuffer(5,5,1);
    g.flip = function(){show(this.buffer);};
    
    var x = 0;
    setInterval(function() {
      x++;
      if (x>50)x=0;
      g.clear();
      g.drawString("Espruino",5-x);
      g.flip();
    }, 100);
    

    But nothing.

    Instead, when I have try the BLE keyboard example:

    var kb = require("ble_hid_keyboard");
    NRF.setServices(undefined, { hid : kb.report });
    
    function btnPressed() {
      // Send 'a'
      kb.tap(kb.KEY.A, 0, function() {
        // Followed by capital 'A'
        kb.tap(kb.KEY.A, kb.MODIFY.SHIFT);
      });
    }
    
    // trigger btnPressed whenever the button is pressed
    setWatch(btnPressed, BTN, {edge:"rising",repeat:true,debounce:50});
    

    It worked (but only when I press A button, not B).

    Where am I wrong?

    Thank you for your replies!

About

Avatar for coat @coat started