Skip to content

Add NIST based temperature calculation #13

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

Merged
merged 3 commits into from
Oct 3, 2019
Merged

Conversation

caternuson
Copy link
Contributor

For #12. Adds a fancier temperature calculation which the older library had:
https://github.com/adafruit/Adafruit_Python_MAX31855/blob/master/Adafruit_MAX31855/MAX31855.py#L99

$ python3
Python 3.6.8 (default, Aug 20 2019, 17:12:48) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import board, digitalio, adafruit_max31855
>>> cs = digitalio.DigitalInOut(board.C0)
>>> spi = board.SPI()
>>> max = adafruit_max31855.MAX31855(spi, cs)
>>> max.temperature
25.5
>>> max.temperature_NIST
25.46810379959506
>>>

@caternuson caternuson requested a review from a team October 3, 2019 15:21
@ladyada
Copy link
Member

ladyada commented Oct 3, 2019

by chance did you try running on circuitpy? no reason it shouldnt run but sometimes circuitpython is more constrained on something

@caternuson
Copy link
Contributor Author

Didn't, but did just now:

Adafruit CircuitPython 4.1.0 on 2019-08-02; Adafruit ItsyBitsy M4 Express with samd51g19
>>> import board, digitalio, adafruit_max31855
>>> cs = digitalio.DigitalInOut(board.D7)
>>> spi = board.SPI()
>>> max = adafruit_max31855.MAX31855(spi, cs)
>>> max.temperature
25.5
>>> max.temperature_NIST
25.4659
>>>

and holding between fingers to generate something more than ambient:

>>> max.temperature, max.temperature_NIST
(30.25, 30.3106)
>>> max.temperature, max.temperature_NIST
(33.25, 33.3566)
>>> max.temperature, max.temperature_NIST
(34.0, 34.1181)
>>>

@ladyada
Copy link
Member

ladyada commented Oct 3, 2019

good enough for government work!

@ladyada ladyada merged commit 447c961 into adafruit:master Oct 3, 2019
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Oct 4, 2019
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