Ceci est une ancienne révision du document !
#!/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)
sudo apt-get install lirc
sudo nano /etc/modules
useless
lirc_dev lirc_rpi gpio_out_pin=22
gpio_out_pin parameter points to the pin controlling the IR LED
LIRCD_ARGS="--uinput" LOAD_MODULES=true DRIVER="default" DEVICE="/dev/lirc0" MODULES="lirc_rpi" LIRCD_CONF="" LIRCMD_CONF=""
dtoverlay=gpio-ir,gpio_pin=18 dtoverlay=gpio-ir-tx,gpio_pin=22
driver = default device = /dev/lirc0
sudo reboot
Put the remotes you want to use in /etc/lirc/lircd.conf.d/
.
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
$ pronto2lirc
Input format: KEY_NAME:HEX_VALUE HEX_VALUE HEX_VALUE…
wget https://github.com/joan2937/pigpio/archive/master.zip unzip master.zip cd pigpio-master make sudo make install
If the Python part of the install fails it may be because you need the setup tools.
sudo apt install python-setuptools python3-setuptools