Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some mode setters seem to have no effect #124

Open
FreddiEichhorn opened this issue Jun 16, 2024 · 1 comment · May be fixed by #126
Open

Some mode setters seem to have no effect #124

FreddiEichhorn opened this issue Jun 16, 2024 · 1 comment · May be fixed by #126

Comments

@FreddiEichhorn
Copy link

Some of the mode setters seem to have no effect. Specifically, these are the setters for gyro bandwith, gyro range and accel range. There may be others too that I havent tried. Some minimal code for reproduction:

import adafruit_bno055
import board

def main():
i2c = board.I2C()
sensor = adafruit_bno055.BNO055_I2C(i2c)

sensor.mode = adafruit_bno055.AMG_MODE  # Needs to not be fusion mode
print('Gyro range before ', sensor.gyro_range)
sensor.gyro_range = adafruit_bno055.GYRO_125_DPS
print('Gyro range after ', sensor.gyro_range, ' should be ', adafruit_bno055.GYRO_125_DPS)
print('Gyro bandwidth before ', sensor.gyro_bandwidth)
sensor.gyro_bandwidth = adafruit_bno055.GYRO_116HZ
print('Gyro bandwidth after ', sensor.gyro_bandwidth, ' should be ', adafruit_bno055.GYRO_116HZ)
print('Accel range before ', sensor.accel_range)
sensor.accel_range = adafruit_bno055.ACCEL_2G
print('Accel range after ', sensor.accel_range, ' should be ', adafruit_bno055.ACCEL_2G)
@FreddiEichhorn FreddiEichhorn changed the title Many some mode setters seem to have no effect Some mode setters seem to have no effect Jun 16, 2024
@FreddiEichhorn
Copy link
Author

After looking at the datasheet, I've realized that the sensor needs to be in config mode to change these settings. I think the appropriate setter methods should check for this and either throw a warning or change sensor mode accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant