Cov txheej txheem:
- Kauj Ruam 1: Piav Tes Taw Kev Piav Qhia
- Kauj ruam 2: Un-even Dimming
- Kauj Ruam 3: nce thiab nqis hauv ib qho rau ()
Video: Teem ib qho LED hauv thiab Tawm: 3 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:29
Cov theem hauv qab no yog kev sim ua piv txwv seb LEDs ua haujlwm li cas. Lawv piav qhia yuav ua li cas dim ib qho LED ntawm tus nqi sib npaug thiab yuav ua li cas kom nws ploj mus thiab tawm.
Koj yuav xav tau:
- Arduino (Kuv siv duo)
- Cov qhob cij
- 5 hli liab LED
- 330 Ω Resistor (Tsis tseem ceeb 330-560 Ω yuav ua haujlwm.)
- 22 Kev Ntsuas Cov Khoom Hookup Hlau
Cov ntu xav tau rau cov kev sim no suav nrog hauv txhua qhov khoom siv Arduino pib.
Kauj Ruam 1: Piav Tes Taw Kev Piav Qhia
LEDs ib txwm khiav ntawm tib qhov hluav taws xob tsis hais txog qhov ci ntsa iab. Qhov ci ntsa iab tau txiav txim siab los ntawm ib puag ncig yoj oscillator thiab lub sijhawm uas qhov hluav taws xob siab txiav txim siab qhov ci ci. Qhov no hu ua Pulse Width Modulation (PWM). Qhov no yog tswj los ntawm Arduino analogWrite (tus pin, n) ua haujlwm qhov twg n muaj tus nqi los ntawm 0 txog 255. Cov analogWrite () tso tawm PWM, tsis yog qhov tseeb analog. Yog n = 2 LED yuav ci dua li n = 1. Qhov ci ci ib txwm ob npaug thaum n ob npaug. Yog li n = 255 yuav yog ob zaug ci li n = 128.
Tus nqi ntawm n feem ntau qhia raws li feem pua hu ua lub voj voog ua haujlwm. Cov duab qhia pom oscilloscope taug qab rau 25, 50 thiab 75% kev ua haujlwm.
Kauj ruam 2: Un-even Dimming
Tsim lub Circuit Court zoo li hauv daim duab. Qhov no zoo ib yam li lub voj voog kom ntsais ib qho LED. Nws siv tus pin 9 vim tias koj xav tau siv PWM qhib tus pin.
Luam/Muab cov duab kos hauv qab no rau hauv Arduino IDE thiab khiav nws.
Koj yuav pom tias qhov ci ntsa iab ntawm LED yog qhov qeeb nws dims. Raws li nws tau ze rau qhov dimmest nws yuav tau dimmer sai heev.
void teeb tsa ()
{pinMode (9, OUTPUT); } void loop () {int tus pin = 9; rau (int i = 255; i> -1; i--) {analogWrite (tus pin, kuv); ncua (10); } rau (int i = 0; i <256; i ++) {analogWrite (tus pin, kuv); ncua (10); }}
}
Cov kauj ruam tom ntej qhia yuav ua li cas dim lub LED ntawm tus nqi tas li, thiab hauv ib qho rau nqe lus.
Kauj Ruam 3: nce thiab nqis hauv ib qho rau ()
Rau LED kom dim ntawm qhov tsis tu ncua ncua () yuav tsum nce ntawm qhov nthuav tawm vim tias ib nrab ntawm lub luag haujlwm yuav ib txwm ua ib nrab qhov ci ntsa iab. Kuv thawj qhov kev xav yog sim siv daim ntawv qhia () ua haujlwm tab sis nws yog kab.
Kab:
int d = (16-i/16)^2;
laij cov xwm txheej hloov pauv ntawm qhov ci ci los txiav txim qhov ncua ntawm qhov ncua.
Luam/Muab cov duab kos hauv qab no rau hauv Arduino IDE thiab koj yuav pom tias LED yuav ploj mus thiab tawm ntawm qhov tsis tu ncua.
void teeb tsa ()
{pinMode (9, OUTPUT); } tsis muaj dab tsi voj () {int x = 1; tus pin = 9; rau (int i = 0; i> -1; i = i + x) {int d = (16 -i/16)^2; analogWrite (tus pin, kuv); ncua (d); yog (i == 255) x = -1; // hloov kev taw qhia ntawm qhov siab tshaj plaws}}
Pom zoo:
Yuav Ua Li Cas Thiaj Li Tawm Tawm Tawm Tawm Rau Hauv Kev Hloov Pauv Hloov?: 6 Cov Kauj Ruam
Yuav Ua Li Cas Thiaj Li Ua Tus Tawm Tawm Tawm Rau Hauv Kev Hloov Transformer?: Yog tias koj xav tau tus tswv lub zog hloov pauv, tom qab ntawd koj yuav tsum tau nyeem kab lus no. Peb yuav xav ua kom tus neeg hloov pauv ntawm txhais ceg txav mus, ua haujlwm yooj yim thiab hais ob peb yam, lossis tseem paub yuav ua li cas sawv, zaum thiab yoj tes. Lub zog los ntawm
Kho Ob Chav Tawm Tawm Tawm Tawm Tawm Cov Khoom Siv Hluav Taws Xob: 10 Cov Kauj Ruam (nrog Duab)
Kho Ob Chav Tawm Tawm Tawm Tawm Tawm Tawm Cov Khoom Siv Hluav Taws Xob: Nta: AC-DC Hloov pauv ob npaug tso tawm qhov hluav taws xob (Zoo-Hauv av-Tsis Zoo) Kho txoj kab zoo thiab tsis zoo Tsuas yog Ib Leeg Ib Leeg AC hloov pauv cov suab nrov (20MHz-BWL, tsis muaj thauj khoom): Ib puag ncig 1.12mVpp Tsawg suab nrov thiab cov txiaj ntsig ruaj khov (zoo tagnrho
Lub Sijhawm Teem Sijhawm Teem Sijhawm ntawm RaspberryPi-4: 6 Cov Kauj Ruam (nrog Duab)
Lub Sijhawm Teem Sijhawm Teem Sijhawm ntawm RaspberryPi-4: Hauv Cov Lus Qhia no peb yuav ua lub ntsej muag-paub lub sijhawm tiag tiag ntawm Raspberry Pi 4 nrog Shunya O/S siv Shunyaface Library. Koj tuaj yeem ua tiav qhov ntsuas pom ntawm 15-17 ntawm RaspberryPi-4 los ntawm kev ua raws cov lus qhia no
RaspberryPi: Teem ib qho LED hauv thiab Tawm: 4 Kauj Ruam (nrog Duab)
RaspberryPi: Fade ib qho LED hauv thiab Tawm: Cov kauj ruam hauv qab no yog kev sim ua piv txwv seb LEDs ua haujlwm li cas. Lawv qhia yuav ua li cas dim ib qho LED ntawm tus nqi sib npaug thiab yuav ua li cas thiaj ploj nws hauv thiab tawm. Koj yuav xav tau: RaspberryPi (Kuv siv Pi qub, kuv Pi-3 tab tom siv, tab sis Pi yuav ua haujlwm.) Breadboard
Yuav Ua Li Cas Txuas Tus Fader Nrog Kev Tawm Suab thiab Tawm Tawm: 14 Cov Kauj Ruam
Yuav Ua Li Cas Txuas Tus Fader Nrog Suab Tawm Tswv Yim thiab Tawm Tawm: Tus fader yog ib qho ntawm cov hauv paus ntsiab lus rau kev sib xyaw ua ke. Koj tuaj yeem tswj hwm koj lub hauv paus nrog kev txav ntawm fader. Muaj ntau txoj hauv kev los siv cov khawm thawb hauv koj cov phiaj xwm (piv txwv li nyiag nkas nas thiab keyboard, lossis Arduino, tau txais, MC