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

useless

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=""

/boot/config.txt

dtoverlay=gpio-ir,gpio_pin=18
dtoverlay=gpio-ir-tx,gpio_pin=22

/etc/lirc/lirc_options.conf

driver          = default 
device          = /dev/lirc0

Reboot

sudo reboot

LIRC SEND COMMANDS

Put the remotes you want to use in /etc/lirc/lircd.conf.d/.

CONF WITH RAW (PRONTO?) CODES

begin remote
 
   name  MY_REMOTE
   flags RAW_CODES
   eps            30
   aeps          100
 
   frequency    38000
# note ensure the modulation frequency above correctly matches your remote, default is set to 38kHz
# you can also try other common frequencies (36000,40000,56000) if you are unsure
 
       begin raw_codes
 
           name MY_TEST
...<<PUT THE RAW CODE HERE >>...  
 
    end raw_codes
end remote

PRONTO TO LIRC CONF FILE

$ pronto2lirc

Input format: KEY_NAME:HEX_VALUE HEX_VALUE HEX_VALUE…

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