You've already forked MicroPythonOS
mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
Fix MPU6886 X-Axis
MPU6886 is part of M5Stack FIRE. I compare the values from this device with Waveshare ESP32-S3-Touch-LCD-2: The X-axis values are inverted. Fix this here.
This commit is contained in:
@@ -59,7 +59,7 @@ class MPU6886:
|
||||
|
||||
def _read_xyz(self, reg: int, scale: float) -> tuple[int, int, int]:
|
||||
data = self.i2c.readfrom_mem(self.address, reg, 6)
|
||||
x = twos_complement(data[0] << 8 | data[1], 16)
|
||||
x = twos_complement(data[0] << 8 | data[1], 16) * -1
|
||||
y = twos_complement(data[2] << 8 | data[3], 16)
|
||||
z = twos_complement(data[4] << 8 | data[5], 16)
|
||||
return (x * scale, y * scale, z * scale)
|
||||
|
||||
Reference in New Issue
Block a user