淘宝上买了IR模块和小的LCD

Standard


淘宝上买了IR模块和块LCD
加上之前买的那个グーグル…
准备有空时至少把家里的灯和电视都语音控制起来

pi@raspberrypi:~ $ sudo apt-get install lirc
 
pi@raspberrypi:~ $ cat /etc/modules
i2c-dev
lirc_dev
lirc_rpi gpio_in_pin=18 gpio_out_pin=17
 
pi@raspberrypi:~ $ cat /etc/lirc/hardware.conf
LIRCD_ARGS="--uinput --listen"
LOAD_MODULES=true
DRIVER="default"
DEVICE="/dev/lirc0"
MODULES="lirc_rpi"
 
pi@raspberrypi:~ $ cat /etc/lirc/lirc_options.conf
[lircd]
...
driver          = default
device          = /dev/lirc0
...
 
pi@raspberrypi:~ $ sudo reboot
pi@raspberrypi:~ $ sudo systemctl stop lircd
pi@raspberrypi:~ $ mode2 -m -d /dev/lirc0 > tv.txt
pi@raspberrypi:~ $ cat tv.txt
Using driver default on device /dev/lirc0
 16777215
 
     8946     4508      535      585      533      585
      556      562      569      549      553      565
      567      551      534      584      570      548
      569     1669      532     1702      570     1666
      567     1670      555     1681      533     1702
      535      584      572     1664      570     1667
      566      551      535     1701      534     1703
      534      583      535      584      555      563
      534      585      535      582      557     1680
      533      584      534      585      555     1680
      534     1702      568     1669      534     1702
      534    41154
 
     8952     2271      556
 
pi@raspberrypi:~ $ sudo vi /etc/lirc/lircd.conf.d/tvjp.conf
begin remote
 
  name   tvjp
  flags  RAW_CODES
  eps     30
  aeps   100
 
  ptrail   0
  repeat 0 0
  gap 28205
 
  begin raw_codes
 
    name off
     8946     4508      535      585      533      585
      556      562      569      549      553      565
      567      551      534      584      570      548
      569     1669      532     1702      570     1666
      567     1670      555     1681      533     1702
      535      584      572     1664      570     1667
      566      551      535     1701      534     1703
      534      583      535      584      555      563
      534      585      535      582      557     1680
      533      584      534      585      555     1680
      534     1702      568     1669      534     1702
      534    41154
 
     8952     2271      556
 
    name on
     8946     4508      535      585      533      585
      556      562      569      549      553      565
      567      551      534      584      570      548
      569     1669      532     1702      570     1666
      567     1670      555     1681      533     1702
      535      584      572     1664      570     1667
      566      551      535     1701      534     1703
      534      583      535      584      555      563
      534      585      535      582      557     1680
      533      584      534      585      555     1680
      534     1702      568     1669      534     1702
      534    41154
 
     8952     2271      556
 
  end raw_codes
end remote
 
pi@raspberrypi:~ $ sudo systemctl start lircd
pi@raspberrypi:~ $ irsend LIST tvjp ""      
0000000000000001 off
0000000000000002 on
 
pi@raspberrypi:~ $  irsend SEND_ONCE tvjp on
pi@raspberrypi:~ $  irsend SEND_ONCE tvjp off

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.