Isishwankathelo somxholo:
1 Umgaqo we-infrared signal transmitter
2 Imbalelwano phakathi kwesidlulisi somqondiso we-infrared kunye nomamkeli
3 Umzekelo wokuphunyezwa komsebenzi we-infrared transmitter
1 Umgaqo we-infrared signal transmitter
Eyokuqala sisixhobo ngokwaso esikhupha isignali ye-infrared, ekhangeleka ngolu hlobo:
Ububanzi be-infrared diode emfanekisweni ngu-3mm, kwaye enye i-5mm.
Ziphantse zifana ncakasana nee-LED ezikhupha ukukhanya, ngoko ke izikhonkwane ezinde ziqhagamshelwe kwisibonda esilungileyo, kwaye enye idityaniswe kwipali engalunganga.
Eyona ndlela ilula yokuqhuba isekethe kukongeza i-1k yangoku yokukhawulela i-resistor kwisitalato esihle 3.3v, kwaye emva koko udibanise i-electrode engalunganga kwi-IO yomlawuli omncinci.Njengoko kubonisiwe ngezantsi:
2 Imbalelwano phakathi kwesidlulisi somqondiso we-infrared kunye nomamkeli
Sele ndiyithethile loo nto, kufuneka ndilungise impazamo kwinqaku elilandelayo kunye nawe.
Kulo mfanekiso ungentla, kukhankanyiwe ukuba amanqanaba omqondiso we-transmitter kunye nomamkeli bachasene.Oko kukuthi, kuyafana nomxholo ojikelezileyo kwiibhokisi ezibomvu neziluhlaza okwesibhakabhaka kulo mfanekiso ungentla.
Ngapha koko, kowona mgangatho wamaza, inxalenye eluhlaza okwesibhakabhaka ye-transmitter ayilona nqanaba lilula le-0.56ms.Endaweni yoko, yi-0.56ms pwm wave ye-38kHz.
Eyona ndlela ilinganisiweyo yamaza ngolu hlobo lulandelayo:
Iinkcukacha zamaza ombala wenxalenye yesidluliseli kumzobo zimi ngolu hlobo lulandelayo:
Kuya kubonakala ukuba ukuphindaphinda kweli gagasi le-square elixineneyo yi-38kHz.
Nasi isishwankathelo: imbalelwano phakathi komthumeli kunye nomamkeli wolawulo olukude lwe-infrared:
Xa i-transmitter ikhupha i-38kHz square wave, umamkeli uphantsi, kungenjalo umamkeli uphezulu.
3 Umzekelo wokuphunyezwa komsebenzi we-infrared transmitter
Ngoku makhe sigqithele kwiprogramu practice.
Ngokwentshayelelo yangaphambili, siyazi ukuba ukuqonda umsebenzi wolawulo olukude lwe-infrared, kufuneka siqale siqonde imisebenzi emibini esisiseko:
I-1 38kHz imveliso yamaza yesikwere
2 Lawula i38kHz isikweri samaza ukuze uvule kwaye ucime ngexesha elifunekayo
Eyokuqala yi-38kHz ye-square wave wave.Sisebenzisa nje i-pwm wave ukuyivelisa.Apha, kufuneka sisebenzise umsebenzi we-pwm wexesha.Ndisebenzisa itshiphu ye-STM32L011F4P6 yamandla aphantsi apha.
Okokuqala sebenzisa isixhobo sokuvelisa ikhowudi ityhubhu ukwenza ikhowudi:
Ikhowudi yokuqalisa:
Emva koko kukho umsebenzi wokuvula okanye ukucima i-wave ye-pwm ngokwemigaqo yekhowudi, ephunyezwa kusetyenziswa ukuphazamisa ixesha, kwaye emva koko ulungise ubude bexesha i-wave ye-pwm ivuliwe okanye icinyiwe ngokuguqula ixesha lokufika elilandelayo. phazamisa:
Kusekho ezinye iinkcukacha zedatha ekhowudiweyo engayi kuthunyelwa apha.Ukuba ufuna ikhowudi yomthombo ongaphezulu, wamkelekile ukuba ushiye umyalezo, kwaye ndiya kukubonelela ngekhowudi eneenkcukacha ngokukhawuleza.
Ixesha lokuposa: Feb-24-2022