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

Add Temperature Oversampling #48

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

brian-eng
Copy link
Contributor

Similar to #22 but for temperature oversampling.

The 0xE7FF mask comes from manipulating bits 12 and 13 of the register: so 1110 0111 1111 1111 in hex

The internal OSR2 name is what the datasheet calls this parameter. No reason to have separate settings for this as it uses the same values as the existing OSR ones.

mlx.temperature_oversampling = adafruit_mlx90393.OSR_3

@FoamyGuy could you review?

Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this. I had one question about whether we can remove a statement from the init.

@@ -247,6 +249,7 @@ def __init__( # pylint: disable=too-many-arguments
# Set gain to the supplied level
self.gain = self._gain_current
self.temperature_compensation = self._temperature_compensation
self.temperature_oversampling = self._osr2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does self.temperature_oversampling need to get set here? It seems like the getter/setter properties will override this immediately. Maybe we can remove it here inside of init.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just copying what all the other settings were doing.

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 this pull request may close these issues.

2 participants