Archived
1
0

Minor changes to variable naming in pb.py

This commit is contained in:
Shaun Setlock
2021-10-18 20:22:07 -04:00
parent 11a1477d6c
commit f7aa608ae7
2 changed files with 551 additions and 3 deletions

View File

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