Im trying to read a GPIO Pin on my Raspberry Pi with python and dont know how to read more Values than just 0(LOW)
or 1(HIGH)
(GPIO.input) because i have this rotary Switch
GPIO.setup(15,GPIO.IN)
VALUE=GPIO.input(14)
Im trying to read a GPIO Pin on my Raspberry Pi with python and dont know how to read more Values than just 0(LOW)
or 1(HIGH)
(GPIO.input) because i have this rotary Switch
GPIO.setup(15,GPIO.IN)
VALUE=GPIO.input(14)
I think this might help.
gpiozero:
import Button
from time import sleep
button = Button(2)
while True:
if button.is_pressed:
print("Pressed")
else:
print("Released")
sleep(1)