-
Notifications
You must be signed in to change notification settings - Fork 21
Lsm6ds refactor #2
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
Conversation
adafruit_lsm6ds.py
Outdated
|
||
self._accel_range = AccelRange.RANGE_4G #pylint: disable=no-member | ||
self._cached_accel_range = self._accel_range |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this line here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I usually have lines like these to set the default values to something more useful, though 250dps should change then as it's already the default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self._cached_accel_range = self._accel_range
should be handled within the property/setter right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, you're right. I misunderstood
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set it to None at the top of init
adafruit_lsm6ds.py
Outdated
self._cached_accel_range = self._accel_range | ||
self._gyro_range = GyroRange.RANGE_250_DPS #pylint: disable=no-member | ||
self._cached_gyro_range = self._gyro_range |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
can merge once passing |
Updating https://github.com/adafruit/Adafruit_CircuitPython_HT16K33 to 2.6.0 from 2.3.1: > Merge pull request adafruit/Adafruit_CircuitPython_HT16K33#47 from makermelissa/marquee > Merge pull request adafruit/Adafruit_CircuitPython_HT16K33#49 from makermelissa/matrix_scroll > update pylint examples directive > Merge pull request adafruit/Adafruit_CircuitPython_HT16K33#41 from vdehors/master > Merge pull request adafruit/Adafruit_CircuitPython_HT16K33#46 from adafruit/dherrada-patch-1 Updating https://github.com/adafruit/Adafruit_CircuitPython_LSM6DS to 2.0.0 from 1.0.0: > Update README.rst > Update README.rst > Merge pull request adafruit/Adafruit_CircuitPython_LSM6DS#2 from adafruit/lsm6ds_refactor > update pylint examples directive > Merge pull request adafruit/Adafruit_CircuitPython_LSM6DS#1 from adafruit/dherrada-patch-1 > added additional rates & sensor identifier Updating https://github.com/adafruit/Adafruit_CircuitPython_MLX90640 to 1.0.2 from 1.0.1: > Merge pull request adafruit/Adafruit_CircuitPython_MLX90640#7 from dglaude/patch-1 > Merge pull request adafruit/Adafruit_CircuitPython_MLX90640#8 from caternuson/iss2 > Merge pull request adafruit/Adafruit_CircuitPython_MLX90640#5 from dglaude/patch-1 > Merge pull request adafruit/Adafruit_CircuitPython_MLX90640#4 from adafruit/dherrada-patch-1 Updating https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing to 1.9.4 from 1.9.3: > Merge pull request adafruit/Adafruit_CircuitPython_FeatherWing#51 from makermelissa/master > update pylint examples directive > Merge pull request adafruit/Adafruit_CircuitPython_FeatherWing#50 from adafruit/dherrada-patch-1 Updating https://github.com/adafruit/Adafruit_CircuitPython_MotorKit to 1.3.3 from 1.3.2: > Merge pull request adafruit/Adafruit_CircuitPython_MotorKit#24 from caternuson/iss23 Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA: > Added the following libraries: Adafruit_CircuitPython_LSM6DS
This refactor makes subclasses for each sensor and pulls unique code into each subclass