From 0672904e41d91fb6a9e8db30685bd0bf05192394 Mon Sep 17 00:00:00 2001 From: Kshitij Date: Mon, 7 Oct 2024 01:52:09 +0530 Subject: [PATCH] Removed PIN variables. --- temp-calc.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/temp-calc.py b/temp-calc.py index cfa3a4d..b166231 100755 --- a/temp-calc.py +++ b/temp-calc.py @@ -1,13 +1,9 @@ -# Specify the pin you'll be connecting the data/signal PIN of DHT11 to here: -PIN = 16 -DPIN = "D" + str(PIN) - import time -from board import PIN # By default I'm using GPIO PIN 16 +import board import adafruit_dht # Initial the dht device, with data pin connected to: -dhtDevice = adafruit_dht.DHT11(DPIN) +dhtDevice = adafruit_dht.DHT11(board.D16) # by default I'm using GPIO PIN 16 for data/signal transmission of DHT11 # you can pass DHT22 use_pulseio=False if you wouldn't like to use pulseio. # This may be necessary on a Linux single board computer like the Raspberry Pi,