Skip to main content

Send and receive IR commands using pigpio

Project description

ircodec

A Python package that simplifies sending and receiving IR signals for the Raspberry Pi using pigpiod.

Requirements

pip install pigpio

Install

For Raspbian 9 (stretch)

pip install ircodec

For others

git clone git@github.com:kentwait/ircodec.git
cd ircodec
python setup.py install

Quickstart

# Create a CommandSet for your remote control
# GPIO for the IR receiver: 23
# GPIO for the IR transmitter: 22
from ircodec.command import CommandSet
controller = CommandSet(emitter_gpio=22, receiver_gpio=23, description='TV remote')

# Add the volume up key
controller.add('volume_up')
# Connected to pigpio
# Detecting IR command...
# Received.

# Send the volume up command
controller.emit('volume_up')

# Remove the volume up command
controller.remove('volume_up')

# Examine the contents of the CommandSet
controller
# CommandSet(emitter=22, receiver=23, description="TV remote")
# {}

# Save to JSON
controller.save_as('tv.json')

# Load from JSON
new_controller = CommandSet.load('another_tv.json')

Acknowledgment

pigpio Python examples

Contact

kentkawashima@gmail.com

License: MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ircodec-0.3.0.tar.gz (7.0 kB view hashes)

Uploaded Source

Built Distribution

ircodec-0.3.0-py3-none-any.whl (8.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page