From 4b69ae8f8fbc31f49def5736a39aaab9c7c97122 Mon Sep 17 00:00:00 2001 From: Jan Erik Andersen Date: Sat, 29 Jan 2022 12:57:06 +0100 Subject: [PATCH] Update gpio_button.py The btnpin is wrong if you follow the diagram in the book and there is a typo in line 19 as well! --- Chapter 4/gpio_button.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Chapter 4/gpio_button.py b/Chapter 4/gpio_button.py index 4c427f5..eb3389e 100644 --- a/Chapter 4/gpio_button.py +++ b/Chapter 4/gpio_button.py @@ -8,7 +8,7 @@ GPIO.setwarnings(False) # Define pin -btnPin = 20 +btnPin = 17 GPIO.setup(btnPin, GPIO.IN, pull_up_down = GPIO.PUD_UP) # Begin while loop @@ -16,5 +16,5 @@ btnVal = GPIO.input(btnPin) # If the pin is low, print to terminal - if (btnVal == false): + if (btnVal == False): print(‘Button pressed’)