1
0
Fork 0
pull/187/merge
George Griffin 2021-06-03 20:56:13 +01:00 committed by GitHub
commit 41fe58b98b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -28,7 +28,7 @@ class BMA421:
dev.init()
dev.set_command_register(0xb6)
time.sleep(0.05)
dev.set_reg(bma42x.NV_CONFIG_ADDR, 6);
dev.set_reg(bma42x.NV_CONFIG_ADDR, 6)
# Configure the sensor for basic step counting
dev.write_config_file()
@ -49,3 +49,12 @@ class BMA421:
if value != 0:
raise ValueError()
self._dev.reset_step_counter()
def read_xyz(self):
"""Report the orientation of the device"""
data_tuple = bma42x.BMA42X.read_accel_xyz(self._dev)
return (
data_tuple[1],
data_tuple[0],
-data_tuple[2]
)