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)
评论列表
文章目录