I am having trouble detecting a level change on pin 16 (or any other pin). My script is as follows:
import RPi.GPIO as GPIO from time import sleep GPIO.setmode(GPIO.BOARD) GPIO.setup(16, GPIO.IN, pull_up_down = GPIO.PUD_UP) while True: if GPIO.input(16)==0: print("High") else print("Low") sleep(0.1)
After running this code snippet I get "Low" being printed out constantly, even if I connect pin 16 directly to pin 1 (3.3V) using a jumper wire.
To try and figure out why I was not seeing any change I installed pigpio to run
monitor.py which monitors GPIO for level changes.
After running the script I get:
G=14 l=0 d=159303 G=14 l=1 d=5 G=14 l=0 d=90
Why is a change being detected on Broadcom GPIO 14 which corresponds to physical pin 8, instead of Broadcom GPIO 23 which corresponds to physical pin 16?
Any pointers on what I could be doing wrong are greatly appreciated.