11 lines
265 B
Python
11 lines
265 B
Python
import RPi.GPIO as GPIO
|
|
import time
|
|
GPIO.setmode(GPIO.BCM) # GPIO Numbers instead of board numbers
|
|
GPIO.setup(23, GPIO.IN, pull_up_down=GPIO.PUD_UP)
|
|
|
|
while True:
|
|
#print (GPIO.input(23))
|
|
time.sleep(0.1)
|
|
if (GPIO.input(23) == 0)
|
|
print ("ringing")
|