Skip to content

Commit

Permalink
Subtract 1 from demominator
Browse files Browse the repository at this point in the history
  • Loading branch information
kolcz committed Apr 3, 2024
1 parent 7a05843 commit 51c1fd3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions adafruit_scd4x.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ def _read_data(self) -> None:
self._read_reply(self._buffer, 9)
self._co2 = (self._buffer[0] << 8) | self._buffer[1]
temp = (self._buffer[3] << 8) | self._buffer[4]
self._temperature = -45 + 175 * (temp / 2**16)
self._temperature = -45 + 175 * (temp / (2**16 - 1))
humi = (self._buffer[6] << 8) | self._buffer[7]
self._relative_humidity = 100 * (humi / 2**16)
self._relative_humidity = 100 * (humi / (2**16 - 1))

@property
def data_ready(self) -> bool:
Expand Down

0 comments on commit 51c1fd3

Please sign in to comment.