You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • I was just fiddling with this and, maybe you could try this:

    Puck.accelOn(26);
    Puck.accelWr(0x15,0x10);  // CTRL6-C - XL_HM_MODE=1, low power accelerometer
    Puck.accelWr(0x16,0x80);  // CTRL6-C - G_HM_MODE=1, low power gyro
    Puck.accelWr(0x0D,0x00); // INT1_CTRL - disable
    Puck.accelWr(0x11,0); // CTRL2_G power down gyro
    //Puck.accelWr(0x10,0x60);  // CTRL1_XL accelerometer 416hz
    Puck.accelWr(0x10,0x20);  // CTRL1_XL accelerometer 26hz
    Puck.accelWr(0x58,0x90); // TAP_CFG - enable irq, add filter
    Puck.accelWr(0x5C,0x02); // WAKE_UP_DUR - very low duration
    Puck.accelWr(0x5B,0x02); // WAKE_UP_THS - low threshold
    Puck.accelWr(0x5E,0x20);  // MD1_CFG wakeup on INT1
    
    var idleTimeout;
    Puck.on('accel',a=>{  
      LED.set();
      if (idleTimeout) clearTimeout(idleTimeout);
      else print("Motion", a);
      idleTimeout = setTimeout(function() {
        idleTimeout = undefined;
        LED.reset();
      },500);
      // 32 is tilt
    });
    

    It'll stop the accelerometer from waking up Espruino at all, except when there's movement when it'll give you a series of pulses (picked up by the accel event).

    Should be super low power :)

About

Avatar for Gordon @Gordon started