dispatcher.py 文件源码

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

项目:Peppy 作者: project-owner 项目源码 文件源码
def init_rotary_encoders(self):
        """ Rotary encoders (RE) initializer.  

        This is executed only if RE enabled in config.txt. Two REs are configured this way:
        1. Volume Control: GPIO16 - Volume Up, GPIO26 - Volume Down, GPIO13 - Mute
        2. Tuning: GPIO12 - Move Right, GPIO6 - Move Left, GPIO5 - Select
        RE events will be wrapped into keyboard events with the following assignment:
        Volume Up - '+' key on numeric keypad, Volume Down - '-' key on keypad, Mute - 'x' key         
        """        
        if not self.config[USAGE][USE_ROTARY_ENCODERS]:
            return        
        from event.rotary import RotaryEncoder 
        RotaryEncoder(16, 26, 13, pygame.K_KP_PLUS, pygame.K_KP_MINUS, pygame.K_x)
        RotaryEncoder(12, 6, 5, pygame.K_RIGHT, pygame.K_LEFT, pygame.K_RETURN)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号