micro:bit button problems on v1.95 (works on v1.94)

Posted on
  • With v1.95 on the BBC micro:bit the button watch only fires 1 time.

    setWatch(function(e) {
      if (e.state) console.log("Released");
      else console.log("Pressed");
    }, BTN1, {repeat:true, debounce:20, edge:"both"});
    

    Reverting back to v1.94 this works as expected on the micro:bit.

    This code work OK on Puck.js with v1.95

  • Thanks - I just fixed this and it should be in the latest 'cutting edge' builds and 1v96

    You can fix this in 1v95 with pinMode(BTN1, "input_pulldown") - the polarity of the button reading has now changed so it reads 1 when pressed, 0 when not.

  • The polarity swap in 1v95.176 is a welcome change. Setting the pinMode worked well in 1v95.

    @Gordon thanks for fixing this so quickly

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

micro:bit button problems on v1.95 (works on v1.94)

Posted by Avatar for don @don

Actions