使用pigpio发送和接收ir命令
ircodec的Python项目详细描述
ircodec
一个python包,它简化了使用pigpiod发送和接收覆盆子pi的ir信号。
要求
pip install pigpio
安装
对于Raspbian 9(拉伸)
pip install ircodec
对于其他人
git clone git@github.com:kentwait/ircodec.git
cd ircodec
python setup.py install
快速启动
# Create a CommandSet for your remote control# GPIO for the IR receiver: 23# GPIO for the IR transmitter: 22fromircodec.commandimportCommandSetcontroller=CommandSet(emitter_gpio=22,receiver_gpio=23,description='TV remote')# Add the volume up keycontroller.add('volume_up')# Connected to pigpio# Detecting IR command...# Received.# Send the volume up commandcontroller.emit('volume_up')# Remove the volume up commandcontroller.remove('volume_up')# Examine the contents of the CommandSetcontroller# CommandSet(emitter=22, receiver=23, description="TV remote")# {}# Save to JSONcontroller.save_as('tv.json')# Load from JSONnew_controller=CommandSet.load('another_tv.json')
确认
联系人
许可证:麻省理工学院许可证