hello, I recently got the notification for the new sdk version but I am developing an app for the older versa devices, and the new sdk version broke all of the sensor readings and can't find a solution can someone help me? this all worked just fine before the new sdk release.
accel code: if (Accelerometer) {
const accel = new Accelerometer({ frequency: 1 });
accel.addEventListener("reading", () => {
accelData.text = JSON.stringify({
x: accel.x ? accel.x.toFixed(1) : 0,
y: accel.y ? accel.y.toFixed(1) : 0,
z: accel.z ? accel.z.toFixed(1) : 0
});
});
sensors.push(accel);
accel.start();
} else {
accelLabel.style.display = "none";
accelData.style.display = "none";
console.log("ERROR 404: failed to load Accelerometer info on fitbit because the sensor was not detected.");
}
gyro code:
if (Gyroscope) {
console.log("This device has a Gyroscope!");
const gyroscope = new Gyroscope({ frequency: 1 });
gyroscope.addEventListener("reading", () => {
console.log(
`Gyroscope Reading: \
timestamp=${gyroscope.timestamp}, \
[${gyroscope.x}, \
${gyroscope.y}, \
${gyroscope.z}]`
);
});
gyroscope.start();
} else {
console.log("This device does NOT have a Gyroscope, or is not loading correctly! divice cannot display gyroscope data!");
console.log("ERROR 404: failed to load gyroscope info on fitbit because the sensor was not detected.");
}
Best Answer