I'm using Gear S3 and after update its accelerometer got very slow. Before updated I registered 20-25 samples in 30s. Now, I register 10-12 samples. Someone knows why trouble?
var t0 = 0;
var cont = 0;
function onDeviceMotion(event){
var x = event.acceleration.x.toFixed(2);
var y = event.acceleration.y.toFixed(2);
var z = event.acceleration.z.toFixed(2);
var t = ((new Date().getSeconds() + 60) - t0)%60;
var components = {
x: x,
y: y,
z: z,
t : t
}
counter.innerHTML = cont++;
start.innerHTML = components.t;
console.log(components.x + " " + components.y + " " + components.z + " " + components.t+ " " + new Date().getSeconds() );
}
window.addEventListener('devicemotion', onDeviceMotion);