#btn_poll.py
import RPi.GPIO as GPIO #gpio모듈 사용
import time #time 모듈 사용
GPIO.setmode(GPIO.BCM)
GPIO.setup(24,GPIO.IN)
count =0
while True:
value = GPIO.input(24)
if value == True:
count= count +1
print count
time.sleep(0.1)
'임베디드 > RaspberryPi' 카테고리의 다른 글
| 16x2lcd raspberrypi (0) | 2020.10.29 |
|---|---|
| 라즈베리파이4, 3 핀맵 , 데이터시트 (0) | 2020.10.23 |
| p280 MCP3008 ADC 장치 (0) | 2020.10.23 |
| p267 6-5 콜백방식 (0) | 2020.10.22 |
| p268 6-6 풀업 풀다운 인터럽트 (0) | 2020.10.22 |