0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

LIRCによる赤外線LEDリモコン作成(RaspberryPi)

Last updated at Posted at 2022-07-28

RaspberryPi
 OS:
Raspberry Pi OS with desktop
Release date: April 4th 2022
System: 32-bit
Kernel version: 5.15
Debian version: 11 (bullseye)


sudo apt install lirc
sudo systemctl enable lircd.service

sudo vi /etc/lirc/lirc_options.conf
driver = default
device = /dev/lirc0  ←赤外線発光(リモコンとして使うとき)
#device = /dev/lirc1  ←赤外線受信(ライブラリ作るとき)

上記のdevice設定をどちらかをコメントアウトして、設定
再読み込み
sudo systemctl restart lircd.service


そもそもGPIOポート設定(先にやる)
sudo vi /boot/config.txt

dtoverlay=gpio-ir,gpio_pin=18   ←赤外線受信
dtoverlay=gpio-ir-tx,gpio_pin=17  ←赤外線送信(発光)

sudo reboot


赤外線受信(ライブラリ作り)
mode2 -d /dev/lirc1

 加工して /etc/lirc/lircd.conf.d/*.conf を作る。

 →参照 Thanks
  https://www.indoorcorgielec.com/resources/%E5%BF%9C%E7%94%A8%E4%BE%8B/lirc%E3%81%A7rpitph-monitor-rpz-ir-sensor%E3%81%AE%E8%B5%A4%E5%A4%96%E7%B7%9A%E5%88%B6%E5%BE%A1/

再読み込み(発光に変えて)
sudo systemctl restart lircd.service

リスト反映されたか見る
irsend LIST '' ''

発光してみる
irsend SEND_ONCE aircon on みたいなかんじ

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?