Created
August 5, 2020 03:56
-
-
Save djotaku/d1a0613393bb9f285cddf9acf1107955 to your computer and use it in GitHub Desktop.
unsuccessful humidity readings from ahtx0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import board | |
import adafruit_ahtx0 | |
# Create the sensor object using I2C | |
sensor = adafruit_ahtx0.AHTx0(board.I2C()) | |
while True: | |
#temp = (sensor.temperature * 9.0/5.0) + 32 | |
temp = sensor.temperature * 1.8 + 32 | |
print(f"\nTemperature: {temp:0.1f} F") | |
print(f"status: {sensor.status}") | |
print(f"Humidity: {sensor.relative_humidity:0.1f} %" ) | |
time.sleep(2) | |
#### | |
Here is the output I get to the commandline: | |
Tempuerature: 77.2 F | |
status: 28 | |
Humidity: 0.0% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment