RpiUtils.py 文件源码

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

项目:kalliope 作者: kalliope-project 项目源码 文件源码
def __init__(self, rpi_settings=None, callback=None):
        """
        Class used to:
        - manage RPI GPIO
        - thread to catch mute button signal
        The object receive a rpi settings object which contains pin number to use on the Rpi
        When a signal is caught form the mute button, the callback method from the main controller is called
        :param rpi_settings: Settings object with GPIO pin number to use
        :type rpi_settings: RpiSettings
        :param callback: Callback function from the main controller to call when the mute button is pressed
        """
        super(RpiUtils, self).__init__()
        GPIO.setmode(GPIO.BCM)  # Use GPIO name
        GPIO.setwarnings(False)
        self.rpi_settings = rpi_settings
        self.callback = callback
        self.init_gpio(self.rpi_settings)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号