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

28_humiture.py convert to F #10

Open
markmn123 opened this issue Apr 23, 2021 · 1 comment
Open

28_humiture.py convert to F #10

markmn123 opened this issue Apr 23, 2021 · 1 comment

Comments

@markmn123
Copy link

i have tried putting in temperature = temperature * 9/5.0 + 32 but dont know where exactly it goes.
I keep breaking the script when i put it in
any help is greatly appreciated!

@AnonymoZ
Copy link

AnonymoZ commented Apr 2, 2023

In Python/28_humiture.py look for this chunk (at the complete bottom):

def main():
	print ("Raspberry Pi wiringPi DHT11 Temperature test program\n")
	while True:
		result = read_dht11_dat()
		if result:
			humidity, temperature = result
			print ("humidity: %s %%,  Temperature: %s C`" % (humidity, temperature))
		time.sleep(1)

Replace it by this:

def main():
	print ("Raspberry Pi wiringPi DHT11 Temperature test program\n")
	while True:
		result = read_dht11_dat()
		if result:
			humidity, temperature = result
			print ("humidity: %s %%,  Temperature: %s C`" % (humidity, temperature * 9/5.0 + 32)) 👈
		time.sleep(1)

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

No branches or pull requests

2 participants