Archived
1
0

Initial commit. Includes DHT22 and PushButton.

This commit is contained in:
Shaun Setlock
2021-10-17 12:54:25 -04:00
parent ffea23651c
commit 879a21445d
5 changed files with 1078 additions and 0 deletions

27
pb/pb.py Executable file
View File

@@ -0,0 +1,27 @@
#! env/bin/python3
import RPi.GPIO as GPIO
import time
if __name__ == "__main__":
# Setup for Hardware
PB_PIN = 22
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
# Use the internal pull-down.
GPIO.setup(PB_PIN, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
# Begin detected presses.
i = 0
try:
while True:
if not GPIO.input(PB_PIN):
i += 1
print(f"Hi Gabby! Did you push the button? i = {i}")
time.sleep(0.1)
finally:
GPIO.cleanup()

13
pb/requirements.txt Normal file
View File

@@ -0,0 +1,13 @@
black==21.9b0
click==8.0.3
importlib-metadata==4.8.1
mypy-extensions==0.4.3
pathspec==0.9.0
pkg-resources==0.0.0
platformdirs==2.4.0
regex==2021.10.8
RPi.GPIO==0.7.0
tomli==1.2.1
typed-ast==1.4.3
typing-extensions==3.10.0.2
zipp==3.6.0