You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Not quite sure I understood? You mean it's too sensitive?

    I've just added a bunch of extra modules for the new Puck.js, as well as one to improve the power usage: http://www.espruino.com/Puck.js#on-board­-peripherals

    So you can now do:

    require("puckjsv2-accel-movement").on();­
    var idleTimeout;
    Puck.on('accel',function(a) {
      LED.set();
      if (idleTimeout) clearTimeout(idleTimeout);
      else print("Motion", a);
      idleTimeout = setTimeout(function() {
        idleTimeout = undefined;
        LED.reset();
      },500);  
    });
    // turn off with require("puckjsv2-accel-movement").off()­;
    

    If it's too sensitive, you can do:

    require("puckjsv2-accel-movement").on({
      threshold : 20,
    });
    // ...
    

    The default is 2, so you can just change the value to tweak the sensitivity. There's also a duration option which you can set to ignore short-lived movement.

    I've removed the change for now, but it's not working exactly like before. Do I need to reset the register?

    Using your original code? You could try just power cycling it?

About

Avatar for Gordon @Gordon started