diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2023-12-17 02:10:43 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2023-12-26 11:47:21 -0500 |
commit | 3f84501955c9eb6774f1a3ad0069dbda103bdbae (patch) | |
tree | 16257be50005aa50790ee49c6ff9462c2a89fb94 /klippy/extras/mpu9250.py | |
parent | 43ce7c0b9ad4f30277c10b086b86a0937dbfebbc (diff) | |
download | kutter-3f84501955c9eb6774f1a3ad0069dbda103bdbae.tar.gz kutter-3f84501955c9eb6774f1a3ad0069dbda103bdbae.tar.xz kutter-3f84501955c9eb6774f1a3ad0069dbda103bdbae.zip |
adxl345: Add a read_axes_map() helper function
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/mpu9250.py')
-rw-r--r-- | klippy/extras/mpu9250.py | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/klippy/extras/mpu9250.py b/klippy/extras/mpu9250.py index d1ef9954..d9eb242e 100644 --- a/klippy/extras/mpu9250.py +++ b/klippy/extras/mpu9250.py @@ -59,12 +59,7 @@ class MPU9250: def __init__(self, config): self.printer = config.get_printer() adxl345.AccelCommandHelper(config, self) - am = {'x': (0, SCALE), 'y': (1, SCALE), 'z': (2, SCALE), - '-x': (0, -SCALE), '-y': (1, -SCALE), '-z': (2, -SCALE)} - axes_map = config.getlist('axes_map', ('x','y','z'), count=3) - if any([a not in am for a in axes_map]): - raise config.error("Invalid mpu9250 axes_map parameter") - self.axes_map = [am[a.strip()] for a in axes_map] + self.axes_map = adxl345.read_axes_map(config) self.data_rate = config.getint('rate', 4000) if self.data_rate not in SAMPLE_RATE_DIVS: raise config.error("Invalid rate parameter: %d" % (self.data_rate,)) |