You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Yes, I'm afraid it's an almost impossible problem with only the accelerometer... A Gyro would help no end but the Bangle doesn't have one (Puck.js does).

    But, one hack that might help you is you say that when you're not accelerating, gravity should be 1, and the accelerometer will be pointing towards the earth. So when that happens you know kind-of where you are. For example:

    var Vec3 = require("Vec3");
    var G = new Vec3();
    
    Bangle.on('accel',a=>{
      if (a.mag>0.98 && a.mag<1.02) {
        G = new Vec3(a);
      } else {
        var diff = G.sub(a);
        print(diff);
      }
    });
    
About

Avatar for Gordon @Gordon started