Skip to content
This repository was archived by the owner on Nov 12, 2019. It is now read-only.
This repository was archived by the owner on Nov 12, 2019. It is now read-only.

Can't Read Two Sensor #73

@aliumairs

Description

@aliumairs

Hello,

this library didn't work if me using two sensor dht22 on my raspberry pi3 (raspbian, python2). My program only read one sensor. how to resolve it, thanks before.

code:

import Adafruit_DHT

while 1:

sensor = Adafruit_DHT.DHT22
pin = 13
pin2 = 26
humidity, temperature = Adafruit_DHT.read_retry(sensor, pin)
humidity2, temperature2 = Adafruit_DHT.read_retry(sensor, pin2)

if humidity != None and temperature != None :
	print('Temp={0:0.1f}*C  Humidity={1:0.1f}%'.format(temperature, humidity))
if  humidity2 != None and temperature2 != None :
		print('Temp2={0:0.1f}*C  Humidity2={1:0.1f}%'.format(temperature2, humidity2))
else:
		print('Failed to get reading. Try again!')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions