INFRARED []

Outils pour utilisateurs

Outils du site


INFRARED

Ceci est une ancienne révision du document !


INFRARED

PINOUT / WIRING


SOFTWARE CONFIGURATION

Python Blinking LED Script

#!/usr/bin/python
import RPi.GPIO as GPIO
import time
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(22, GPIO.OUT)
while True:
    GPIO.output(22, True)
    time.sleep(1)
    GPIO.output(22, False)
    time.sleep(1)

LIRC

Install LIRC

sudo apt-get install lirc

Enable and configure the lirc_rpi kernel module.

sudo nano /etc/modules

Add the lines below to the file

lirc_dev
lirc_rpi gpio_out_pin=22

gpio_out_pin parameter points to the pin controlling the IR LED

Edit '/etc/lirc/hardware.conf', and add

LIRCD_ARGS="--uinput"
LOAD_MODULES=true
DRIVER="default"
DEVICE="/dev/lirc0"
MODULES="lirc_rpi"
LIRCD_CONF=""
LIRCMD_CONF=""

Edit '/boot/config.txt'

dtoverlay=gpio-ir,gpio_pin=19 # for receiving data
dtoverlay=gpio-ir-tx,gpio_pin=22 # for sending commands

Edit '/etc/modprobe.d/ir-remote.conf' with the following line

options lirc_rpi gpio_in_pin=18 gpio_out_pin=17

Reboot

sudo reboot

LIRC SEND COMMANDS

documentation/informatique/raspberrypi/infrared/index.1663258658.txt.gz · Dernière modification : de f1sls