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

correct temperature readings for defective ICs + misc. improvements #6

Merged
merged 13 commits into from May 13, 2020
Merged

correct temperature readings for defective ICs + misc. improvements #6

merged 13 commits into from May 13, 2020

Conversation

ghost
Copy link

@ghost ghost commented May 9, 2020

  • correct temperature readings for defective ICs (issue reading temperature / workaround for defective ICs #5)
  • add caveat/code sample in readme wrt. resetting the IC when setting new mode and/or sample rates
  • rename _reset() to reset() ; move calibration stuff out of initialize() into reset()
  • add wait_{temperature,pressure}_ready() functions and use them in initialize()
  • add example code for setting up the sensor for a low power weather station (as per infineon's datasheet)

the changes above shouldn't break code using this library, maybe with the exception of wait_{temperature,pressure}_ready() which throw an exception when the mode isn't properly set in order to avoid infinite waits (but in that case such code would be broken/non-functional anyway).

@ghost
Copy link
Author

ghost commented May 9, 2020

hmm, the PR's automatic test fails at "Check formatting", no idea why. Would need some help here...

@ladyada
Copy link
Member

ladyada commented May 9, 2020

@kattni can help you get it formatted

@ladyada ladyada requested a review from kattni May 9, 2020 16:56
@FoamyGuy
Copy link
Contributor

FoamyGuy commented May 9, 2020

@taradiddles the CI system automatically checks the code with PyLint as well as Black code formatter. You can learn about them and how to use it on your Circuit Python code in the learn guide here: https://learn.adafruit.com/improve-your-code-with-pylint

@kattni
Copy link
Contributor

kattni commented May 11, 2020

@taradiddles As @FoamyGuy said, follow the instructions in the guide. Run black first. That's what's causing the Check formatting failure. Then the CI check will get to Pylint and we will deal with whatever comes next.

@ghost
Copy link
Author

ghost commented May 12, 2020

@FoamyGuy : I just saw your comment, no idea why I didn't receive an email notification (I did for @kattni 's ). Thanks for the link. It took me a bit of time to go through the errors since I'm a python noob but hopefully everything's fixed now.

@ladyada
Copy link
Member

ladyada commented May 12, 2020

looks great, its ready for testing now
@siddacious or @kattni do you have a DPS310 to test with?

@siddacious
Copy link
Contributor

@ladyada I've got one. I'll give it a whirl

Copy link
Contributor

@siddacious siddacious left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks for the help.

One small request and it's good to go.
Also @taradiddles feel free to add yourself to the authors 👍

@@ -296,11 +314,39 @@ def temperature_ready(self):
"""Returns true if there is a temperature reading ready"""
return self._temp_ready

def wait_temperature_ready(self):
"""Wait until a temperature measurement is available"""
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a note to the docstrings for the wait_nnn_ready methods about which modes are supported so that hapless meteorologists aren't ambushed by wild Errors 🐅

@ghost
Copy link
Author

ghost commented May 13, 2020

@siddacious: ready... Had to learn a bit about docstrings and sphinx, hopefully everything's OK.

Also @taradiddles feel free to add yourself to the authors

Thank you ; maybe next time... (at least once I know python a bit better)

@siddacious siddacious merged commit 14cc8ab into adafruit:master May 13, 2020
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request May 15, 2020
Updating https://github.com/adafruit/Adafruit_CircuitPython_BNO055 to 5.0.1 from 5.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_BNO055#49 from russmac/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_DPS310 to 1.1.3 from 1.1.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_DPS310#6 from taradiddles/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_INA219 to 3.4.2 from 3.4.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_INA219#19 from colindgrant/powerdown-constant-spelling

Updating https://github.com/adafruit/Adafruit_CircuitPython_AdafruitIO to 3.2.0 from 3.1.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_AdafruitIO#35 from brentru/add-cellular-example

Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE to 6.1.4 from 6.1.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_BLE#81 from dhalbert/max_length

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Added the following libraries: Adafruit_CircuitPython_LIS331, Adafruit_CircuitPython_BLE_Adafruit
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.

4 participants