소스 검색

GPIO more code

9and3r 11 년 전
부모
커밋
17414dddf3
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      mopidy_touchscreen/gpio_inpput_manager.py

+ 2 - 0
mopidy_touchscreen/gpio_inpput_manager.py

@@ -7,6 +7,8 @@ logger = logging.getLogger(__name__)
 class GPIOManager():
 
     def __init__(self):
+        GPIO.setmode(GPIO.BCM)
+        GPIO.setup(23, GPIO.IN, pull_up_down = GPIO.PUD_DOWN)
         GPIO.add_event_detect(23, GPIO.RISING, callback=self.printFunction, bouncetime=300)