Cov txheej txheem:

Yuav Ua Li Cas Cuam Tshuam TV lossis Lwm Yam Nrog Arduino Irlib: 3 Kauj Ruam (nrog Duab)
Yuav Ua Li Cas Cuam Tshuam TV lossis Lwm Yam Nrog Arduino Irlib: 3 Kauj Ruam (nrog Duab)

Video: Yuav Ua Li Cas Cuam Tshuam TV lossis Lwm Yam Nrog Arduino Irlib: 3 Kauj Ruam (nrog Duab)

Video: Yuav Ua Li Cas Cuam Tshuam TV lossis Lwm Yam Nrog Arduino Irlib: 3 Kauj Ruam (nrog Duab)
Video: yuav coj li cas kom luag nyiam 2024, Hlis ntuj nqeg
Anonim
Yuav Ua Li Cas Ua Li Cas Lub TV Chaw Taws Teeb lossis Lwm Yam Nrog Arduino Irlib
Yuav Ua Li Cas Ua Li Cas Lub TV Chaw Taws Teeb lossis Lwm Yam Nrog Arduino Irlib

Taw qhia

Nyob zoo txhua tus thiab zoo siab txais tos rau kuv thawj Cov Lus Qhia.

Hnub no peb yuav kawm, raws li lub npe hais, kom ua raws e TV nyob deb lossis qee yam zoo sib xws uas ua haujlwm nrog Infrared teeb liab siv Arduino (txhua tus qauv).

Qhov teeb meem yog: Kuv tuaj yeem xa cov lej mus rau yam khoom yog tias kuv tsis paub tus lej?

Tshawb nrhiav hauv internet Kuv tsis pom lo lus teb rau kuv cov lus nug yog li kuv pib xav thiab tsim cov txheej txheem no los ntawm kuv tus kheej.

Hauv qhov kev qhia no kuv yuav qhia koj yuav ua li cas.

P. S.: Yog

Ua ntej peb pib Kuv yuav qhia koj tias Ir kev sib txuas lus nyuaj heev thiab xav tau kev paub me ntsis ua ntej.

Kauj Ruam 1: Khoom

Khoom siv
Khoom siv

Koj xav tau cov khoom siv tsawg dua li koj xav:

-Arduino (Kuv siv Leonardo)

-470ohm lossis zoo sib xws resistor!

-IR coj (Kuv siv SFH4546)

-Qee tus Jumpers

-IR tus txais (Kuv siv TSOP38238)

-Breadboard

Nov yog qhov kuv tau siv rau qhov yooj yim tab sis qhov tseem ceeb Circuit.

Kho: Yog tias koj siv kuv tus coj tib yam, tsis txhob siv ib qho resistor ntawm Arduino tus pin thiab coj vim tias nws yuav txo qis ntau ntawm koj tuaj yeem siv koj cov chaw taws teeb

Yog tias koj tsis siv tib ir coj kuv hais qhia kom muab lub tshuab txiav thiab tswj nws raws li koj xav tau

Kauj ruam 2: Circuit thiab Coding

Tam sim no peb saib mus rau hauv Circuit Court.

Peb yuav tsum tsim 2 lub voj voog:

-Cov thawj Circuit Court yuav tsum tau ntes lub teeb liab los ntawm cov chaw taws teeb tswj.

-Qhov thib ob kis lub teeb liab uas peb tau ntes ua ntej.

Yog li coj mus rau arduino, lub rooj noj mov, cov xov hlau thiab tus txais thiab cia pib ua haujlwm

Ua ntej txuas 5v thiab GND rau koj tus txais (kuv tau txiav txim tawm, GND, 5V)

OUT tus pin xav tau txuas nrog Arduino tus pin 2. (Yuav ua li cas lub Circuit Court zoo li)

Thaum koj tau ua tiav lawm peb yuav tsum txuas Anode ntawm peb coj mus rau tus tiv thaiv thiab Cathode rau hauv av.

Los ntawm tus tiv thaiv peb yuav txuas tom qab rau tus pin uas tau txhais los ntawm Ir tsev qiv ntawv. (Lub Circuit Court zoo li cas)

Cov cai yog yooj yim heev:

Ua ntej peb yuav tsum teeb tsa cov tsev qiv ntawv:

-Lub tsev qiv ntawv IrLib2 rau qhov tau txais kev tso cai

Tom qab ntawd koj xav tau qhib cov ntawv zip thiab luam cov ntawv tais ceev tseg hauv cov ntawv ntawd rau hauv koj lub tsev qiv ntawv tais ceev tseg.

-Lub tsev qiv ntawv IrRemote rau xa nws

Thaum koj tau ua tiav, qhib Arduino IDE thiab los ntawm cov ntawv qhia ua piv txwv mus rau IrLib2 piv txwv cov ntawv tais ceev tseg, tom qab ntawd ntsaws qhov kos duab "RawRecv.ino" ntawm koj li Arduino board.

Thaum nws tau thauj khoom ntawm lub rooj tsavxwm qhib lub saib saib, coj cov chaw taws teeb uas koj xav kom ua raws, tsom nws ntawm Ir tus txais thiab nias lub pob rau nws: koj yuav pom qee qhov tso tawm (tus lej nyoos) ntawm tus saib yog li tsuas yog luam nws hauv daim ntawv teev lus

Kab lus tom ntej yog xa cov lej peb tau txais.

Txhua tus qauv Arduino muaj nws tus kheej tus pin rau chav kawm IRsend thiab koj tsis tuaj yeem hloov nws vim qee qhov txwv los ntawm kho vajtse.

Nov yog lub rooj nrog tus pin teeb tsa ntawm qee qhov Arduino boards.

Nov yog kuv daim duab, nws xa cov channel_up hais kom mus rau Samsung Tv qub:

#suav nrog

Xa rov qab; #define RAW_DATA_LEN 68 // output of RawRecv uint16_t rawData [RAW_DATA_LEN] = {4458, 4482, 546, 1698, 550, 1690, 554, 1690, 546, 606, 518, 610, 526, 602, 522, 606, 526, 602, 522, 1694, 554, 1686, 550, 1694, 550, 602, 522, 606, 530, 598, 526, 602, 522, 606, 526, 602, 522, 1694, 554, 598, 522, 606, 530, 1686, 554, 602, 518, 610, 522, 602, 522, 1694, 554, 602, 522, 162, 1694, 550, 1690, 546, 610, 526, 1690, 546, 1694, 554, 1690, 546, 1000}; void teeb () {} void loop () {irsend.sendRaw (rawData, RAW_DATA_LEN, 38); // xa cov ntaub ntawv raw ntawm 38KHz zaus ncua (1000); // 1 ncua sijhawm thib ob ntawm txhua lub teeb liab tawg}

Them nyiaj mloog: daws thiab muab nws tso rau hauv IDE yuav tsis ua haujlwm, yog tias nws tsis ua haujlwm koj yuav tsum sau txhua kab

Kauj Ruam 3: Xeem thiab Tiav

Nws yog lub sijhawm rau kev sim tam sim no!

Taw tes koj coj mus rau tus neeg txais kev pab tib yam koj taw tes rau cov chaw taws teeb tswj thiab ua kom muaj zog rau koj Arduino, tos ib pliag thiab koj yuav pom tias cov cuab yeej txais yuav pib ua qhov peb qhia nws kom ua li ntawd!

Yog tias muaj qee yam tsis raug thov tawm lus hauv qab no.

Qhov ntawd yog qhov kawg ntawm Peb Cov Lus Qhia. Kuv vam tias nws muaj txiaj ntsig rau koj.

Tawm tswv yim yog tias koj xav tau daim vis dis aus ntawm qhov kev qhia no thiab ……….

mus rau tom ntej Qhia!

Pom zoo: