@TimHanewich
I have run into an issue where using this code with a Pi Pico and checking for 1g in z acceleration it all works correctly for USB power input, but I get ~8g when I use a LiPo battery! I have done ABAB tests and it is a power issue when not using the USB connector, and it does not matter whether I connect 3.7 or 5V, to VSYS or VBUS, result is the same.