infrared receiver module 테스트소스
This commit is contained in:
westnife3 2025-08-27 17:48:05 +09:00
parent 48812a0883
commit d66b9e5f21
1 changed files with 13 additions and 0 deletions

13
tutorial/10.ir_test.py Normal file
View File

@ -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()