Cov txheej txheem:

Rasberry PI Universal IR Chaw Taws Teeb Nrog MATRIX Tus Tsim: 9 Cov Kauj Ruam
Rasberry PI Universal IR Chaw Taws Teeb Nrog MATRIX Tus Tsim: 9 Cov Kauj Ruam

Video: Rasberry PI Universal IR Chaw Taws Teeb Nrog MATRIX Tus Tsim: 9 Cov Kauj Ruam

Video: Rasberry PI Universal IR Chaw Taws Teeb Nrog MATRIX Tus Tsim: 9 Cov Kauj Ruam
Video: Musicians talk about Buckethead 2024, Hlis ntuj nqeg
Anonim
Image
Image

G️ Cov lus qhia no tau dhau los P️

Koj tuaj yeem pom daim ntawv qhia IR tshiab los ntawm qhov txuas hauv qab no

www.hackster.io/matrix-labs/matrix-creator-tv-remote-3e783d

Taw qhia

Cov ntawv qhia no yuav pab koj txhim kho qhov kawg thoob ntiaj teb kev tswj chaw taws teeb siv Raspberry Pi thiab MATRIX Tus Tsim, thawj IR cov chaw txais/xa xov ntxiv rau Raspberry Pi.

Peb tab tom siv LIRC (Linux Infrared Remote Control), uas tsim nyog rau txoj haujlwm no. Nws ua kom yooj yim ntau yam ntawm cov haujlwm nyuaj uas peb xav tau kom ua tiav.

Kauj Ruam 1: Qhov Chaw Koj Yuav Tsum Tau

MATRIX Tus Tsim IR Cheebtsam
MATRIX Tus Tsim IR Cheebtsam
  1. MATRIX Tus Tsim.
  2. Raspberry Pi 2 lossis 3.
  3. 5V 2.0A Fais Fab Khoom.
  4. Ib qho cuab yeej siv IR tau txais kev txhawb nqa los ntawm LIRC (Cov cuab yeej sau tseg kom raug yuav ua rau koj lub neej yooj yim dua)

Kauj Ruam 2: MATRIX Creator IR Cheebtsam

MATRIX Tus Tsim muaj ob qho IR Emitters, ib qho nyob rau sab saum toj ntawm pawg thawj coj thiab lwm tus nyob rau sab hauv qab ntawm nws. Nws tso cai tswj cov cuab yeej tsis hais txog txoj haujlwm ntawm pawg thawj coj.

Tsis tas li nws muaj IR Txais, TSOP573. Nws tso cai rau koj kom tau txais cov lus txib los ntawm virtual ib qho IR transmitter.

Kauj ruam 3: Teeb tsa Software

Zoo siab txais tos rau MATRIX Tus Tsim! Txhawm rau txaus siab rau koj lub rooj tsav xwm tshiab koj yuav tsum teeb tsa nws. Ua ntej, koj yuav tsum muaj Raspbian teeb tsa ntawm koj li Raspberry Pi. Yog tias koj tsis muaj nws, koj tuaj yeem rub nws thiab ua raws cov lus qhia.

Tom qab ntawd koj yuav tsum teeb tsa lub software uas yuav tso cai rau koj rau program MATRIX Creator. Txhawm rau ua nws, koj yuav tsum teeb tsa APT. Cov theem hauv qab no yuav tsum ua nws:

ncha "deb https://packages.matrix.one/matrix-creator/./" | sudo tee --append /etc/apt/sources.list

Tam sim no hloov kho pob ntawv teev npe.

sudo apt-tau hloov tshiab

Tom qab ntawd koj tuaj yeem teeb tsa cov pob khoom xav tau.

sudo apt-tau nruab matrix-creator-init cmake g ++ git

Tam sim no rov pib dua Raspberry Pi. Tom qab rov pib dua FPGA thiab SAM3 MCU yuav npaj rau koj. Ntawd yog, tom qab txhua qhov rov pib dua FPGA yuav ua haujlwm rau koj nrog lub khoos phis tawj qub.

Yog tias koj xav tau, koj tseem tuaj yeem kawm paub ntau ntxiv txog lwm yam ntawm MATRIX Tus Tsim ntawm Github Cov Lus Nug? Tshaj tawm lawv ntawm raspberrypi.stackexchange.com! Siv daim ntawv #matrix-creator

Kauj Ruam 4: Xeem MATRIX Tus Tsim

Thaum koj teeb tsa MATRIX Creator pob koj tseem teeb tsa LIRC hauv koj li Raspberry PI.

Xav tias dawb los ntsuas tus IR tau txais nrog koj lub TV nyob deb, LED hauv MATRIX Tus tsim hluav taws xob ntsais muag thaum twg koj nias lub pob hauv lub chaw taws teeb

Kauj Ruam 5: Xeem LIRC Cov Khoom Siv

Siv LIRC software Khiav cov lus txib thiab nias cov nyees khawm nyob deb ntawm lub sensor thiab koj yuav tsum tau txais qee qhov kev tawm tswv yim. Nws yog qhov tsim nyog kom tsis txhob ua haujlwm lirc.in kom tso IR cov peev txheej.

sudo /etc/init.d/lirc nres

hom2 -d /dev /lirc0

Thaum koj ua qhov no, khiav cov lus txib thiab nias qee cov nyees khawm hauv cov chaw taws teeb thaum tsom nws ntawm lub ntsuas, koj yuav tsum tau txais qee cov lus tawm tswv yim

Nws yuav tsum teb qee yam zoo ib yam li:

pi@user: ~ $ sudo /etc/init.d/lirc nres [ok] Nres nres lirc (ntawm systemctl): lirc.service.

pi@user: ~ $ mode2 -d /dev /lirc0space 7583853 mem tes 2498 qhov chaw 524 mem tes 1278 qhov chaw 519 mem tes 734 qhov chaw 461 mem tes 1309 qhov chaw 488 mem tes 714 qhov chaw 481 mem tes 1309 qhov chaw 488

Kauj Ruam 6: Sau Cov Lus Hais Nrog LIRC

Tom ntej no peb khiav cov lus txib hauv qab no thaum nyob hauv tus neeg siv phau ntawv teev npe (piv txwv li: /home /pi) cov npe, qhov no yuav sau cov lus txib tswj chaw taws teeb.

irrecord -d/dev/lirc0 ~/NAME_OF_CONTROL.conf

Ua raws li cov lus qhia tau muab.

Thaum nws nug txog cov npe tseem ceeb koj yuav tsum siv cov npe ua ntej. Kom tau cov npe Kuv nyiam qhib lub qhov rai tshiab thiab khiav cov lus txib.

irrecord-npe-npe chaw

Thaum koj ua tiav cov txheej txheem no, nws tsim cov ntawv zoo li cov hauv qab no:

# Thov ua cov ntaub ntawv no rau lwm tus # los ntawm kev xa nws mus rau # # daim ntawv teeb tsa no tau tsim tawm ncaj qha # siv lirc-0.9.0-pre1 (default) ntawm Tue Jul 26 21:01:56 2016 # # txhawb los ntawm # # hom: /home/pi/samsung.conf # qauv no. ntawm kev tswj chaw taws teeb: # cov cuab yeej raug tswj los ntawm cov chaw taws teeb no: #

pib tej thaj chaw deb

npe SAMSUNG

khoom 16 tus chij SPACE_ENC | CONST_LENGTH eps 30 aeps 100

npe 4572 4399

ib 638 1597 xoom 638 480 ptrail 639 pre_data_bits 16 pre_data 0xE0E0 kis 107726 toggle_bit_mask 0x0

pib cov lej

KEY_POWER 0x40BF KEY_1 0x20DF KEY_2 0xA05F KEY_3 0x609F KEY_4 0x10EF KEY_5 0x906F KEY_6 0x50AF KEY_7 0x30CF KEY_8 0xB04F KEY_9 0x708F KEY_0 0x8877 KEY_MUTE 0xF00F KEY_CHANNELUP 0x48B7 KEY_CHANNELDOWN 0x08F7 KEY_VOLUMEUP 0xE01F KEY_VOLUMEDOWN 0xD02F KEY_MENU 0x58A7 KEY_EXIT 0xB44B KEY_UP 0x06F9 KEY_DOWN 0x8679 KEY_LEFT 0xA659 KEY_RIGHT 0x46B9 kawg cov lis dej num

kawg tej thaj chaw deb

Kauj Ruam 7: Teeb tsa Cov Ntaub Ntawv rau LIRC

Tam sim no koj yuav tsum hloov kho cov ntaub ntawv teeb tsa /etc/lirc/lircd.conf los ntawm kev ua cov hauv qab no:

Luam cov ntawv saum toj no los ntawm "pib tej thaj chaw deb" txhua txoj hauv kev mus rau "xaus chaw deb" thiab qhib cov ntawv teeb tsa los ntawm kev ua:

sudo nano /etc/lirc/lircd.conf

Hloov cov ntaub ntawv cov ntsiab lus nrog cov ntawv koj tau theej thiab khaws koj cov kev hloov pauv.

pib lub npe deb ntawm SAMSUNG cov khoom 16… kawg cov chaw taws teeb pib chaw taws teeb

npe SONY

khoom 16… kawg cov chaw taws teeb pib chaw taws teeb

npe Panasonic

khoom 16… kawg cov chaw taws teeb

Nco ntsoov hloov chaw nyob deb lub npe los ntawm kev kho lub npe kab.

Kauj Ruam 8: Xa Cov Lus txib

Tam sim no peb thaum kawg tau mus rau qhov txaus siab! xa cov lus txib nyob deb rau cov khoom siv nrog kab xws li:

xa SEND_ONCE lub cuab yeej KEYNAME

Ntaus ntawv yog lub npe koj tau muab rau nws

Txaus siab rau pom koj lub cuab yeej ua haujlwm !!!

Kauj Ruam 9: Xeem Nrog Matrix Creator - HAL

Tam sim no peb tab tom siv Hardware Abstraction Layer ntawm MATRIX Creator.

Rub tawm cov chaw cia khoom hauv qab no los ntawm GitHub

git clone

Mus rau phau ntawv teev npe demos

cd matrix-creator-hal/demos/cov

Ua ke cov demo apps:

mkdir tsim cd tsim cmake../ ua

Thaum kawg khiav lub app:

./ir_demo name_control

Txoj cai no yog qhov kev sim yooj yim los ua ke Everloop thiab LIRC software, nws tsuas yog ua haujlwm nrog KEY_POWER, KEY_VOLUMEUP thiab KEY_VOLUMEDOWN.

Pom zoo: