import time
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.IN) # IR 수신기 연결 핀
try:
while True:
if GPIO.input(18) == 0:
print("IR signal detected!")
time.sleep(0.1)
except KeyboardInterrupt:
GPIO.cleanup()