step.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:pi-thrum 作者: arosspope 项目源码 文件源码
def __initCBs(self):
        """
        Initialises the Callback functions for each Input IO pin
        """
        # Sound Button Callbacks:
        for i in range(6):
            bnt = self.__soundBNTs[i]
            smp = self.__samples[i]
            GPIO.add_event_detect(bnt, GPIO.RISING, callback=lambda x,y=smp:
                                  self.__soundCB(x, y), bouncetime=200)

        # Step Button Callbacks:
        for bnt in self.__stepBNTs:
            GPIO.add_event_detect(bnt, GPIO.RISING, callback=lambda x:
                                  self.__stepCB(x), bouncetime=200)

        # Play Button Callback:
        GPIO.add_event_detect(self.__playBNT, GPIO.RISING, callback=lambda x:
                              self.__playCB(x), bouncetime=200)

        # Record Button Callback:
        GPIO.add_event_detect(self.__recBNT, GPIO.RISING, callback=lambda x:
                              self.__recCB(x), bouncetime=200)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号