Murangariro wezvemukati:
1 Nheyo ye infrared signal transmitter
2 Kunyorerana pakati pe infrared signal transmitter uye inogamuchira
3 Infrared transmitter basa rekuita muenzaniso
1 Nheyo ye infrared signal transmitter
Yekutanga ndiyo mudziyo pachawo unoburitsa infrared siginecha, iyo inowanzoita seizvi:
Iyo dhayamita yeiyo infrared diode pamufananidzo ndeye 3mm, uye imwe yacho 5mm.
Vanenge vakangofanana nemwenje-emitting LEDs, saka mapini akareba akabatanidzwa kune danda rakanaka, uye imwe yacho yakabatana nedanda risina kunaka.
Iyo yakapfava yekutyaira yedunhu ndeyekuwedzera 1k ikozvino inomisa resistor kune yakanaka mugwagwa 3.3v, uye wozobatanidza iyo yakaipa electrode kuIO yeiyo micro controller.Sezvinoratidzwa pasi apa:
2 Kunyorerana pakati pe infrared signal transmitter uye inogamuchira
Ndataura izvozvo, ndinoda kururamisa chikanganiso muchinyorwa chinotevera newe.
Mumufananidzo uri pamusoro, unotaurwa kuti mazinga echiratidzo cheanotumira uye anogamuchira anopesana.Ndiko kuti, zvakafanana nezviri mukati zvakatenderedzwa mumabhokisi matsvuku uye ebhuruu mumufananidzo uri pamusoro.
Muchokwadi, mune chaiyo waveform, iyo yebhuruu chikamu cheiyo transmitter haisi nyore yakakwira mwero we0.56ms.Asi, ndeye 0.56ms pwm wave ye38kHz.
Iyo chaiyo yakayerwa waveform yakaita seiyi:
Iwo waveform ruzivo rweiyo wave color chikamu cheiyo transmitter mumufananidzo ndeaya anotevera:
Zvinogona kuoneka kuti frequency yeiyi dense square wave ndeye 38kHz.
Heino pfupiso: kunyorerana pakati peanotapurirana uye anogamuchira yeiyo infrared remote control:
Kana iyo transmitter ichiburitsa 38kHz square wave, inogamuchira yakaderera, zvikasadaro anogamuchira akakwira.
3 Infrared transmitter basa rekuita muenzaniso
Zvino ngatienderere mberi kune chirongwa chekudzidzira.
Sekureva kwesumo yapfuura, tinoziva kuti kuti tizive basa reiyo infrared remote control, tinofanira kutanga taziva mabasa maviri akakosha:
1 38kHz square wave kubuda
2 Dzora iyo 38kHz square wave yekubatidza nekudzima panguva yaunoda
Yekutanga ndiyo 38kHz square wave kubuda.Isu tinongoshandisa pwm wave kuigadzira.Pano, isu tinofanirwa kushandisa iyo pwm basa reiyo timer.Ndiri kushandisa iyo STM32L011F4P6 yakaderera-simba chip pano.
Kutanga shandisa iyo kodhi yekugadzira chishandiso artifact cube kugadzira iyo kodhi:
Kutanga kodhi:
Kozoita basa rekubatidza kana kudzima pwm wave zvinoenderana nemitemo yekukodha, iyo inoshandiswa uchishandisa timer interrupts, uyezve kugadzirisa hurefu hwenguva iyo pwm wave inovhurwa kana kudzimwa nekugadzirisa nguva yekusvika yeinotevera. kukanganisa:
Pachine mamwe madhata eiyo encoded data isingatumirwe pano.Kana iwe uchida imwe sosi kodhi, unogamuchirwa kusiya meseji, uye ini ndichakupa iyo yakadzama kodhi nekukurumidza sezvinobvira.
Nguva yekutumira: Feb-24-2022