Python Forum
Raspberry PI with DHT22 Sensors
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Raspberry PI with DHT22 Sensors
#2
Is there a reason why you wouldn't make five DHT22Module objects and call them in order?
modules = {pin: DHT22Module(pin) for pin in (2, 3, 4, 17, 27)}

for pin, module in modules.items():
    print(pin, module.get_sensor_readings()
I would remove the prints inside the DHT22Module class (lines 13-19)
Reply


Messages In This Thread
Raspberry PI with DHT22 Sensors - by itpilot - May-11-2023, 12:05 PM
RE: Raspberry PI with DHT22 Sensors - by deanhystad - May-11-2023, 07:02 PM
RE: Raspberry PI with DHT22 Sensors - by itpilot - May-11-2023, 08:01 PM
RE: Raspberry PI with DHT22 Sensors - by deanhystad - May-11-2023, 08:08 PM
RE: Raspberry PI with DHT22 Sensors - by itpilot - May-11-2023, 09:33 PM
RE: Raspberry PI with DHT22 Sensors - by itpilot - May-11-2023, 09:15 PM
RE: Raspberry PI with DHT22 Sensors - by deanhystad - May-12-2023, 02:52 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  get data (temperature and humidity) from DHT22 into CSV and sending them over the net apollo 0 5,034 Apr-16-2021, 07:49 PM
Last Post: apollo
  Convert looping home security to a one time scan of switches and sensors duckredbeard 0 2,251 Dec-08-2020, 04:31 AM
Last Post: duckredbeard

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020