parent
48812a0883
commit
d66b9e5f21
|
|
@ -0,0 +1,13 @@
|
||||||
|
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()
|
||||||
Loading…
Reference in New Issue