Cov txheej txheem:
- Khoom siv
- Kauj Ruam 1: Teeb LED ntawm Breadboard
- Kauj Ruam 2: Teeb LED ntawm Arduino
- Kauj Ruam 3: Teeb Duab Photocell ntawm Breadboard
- Kauj Ruam 4: Txuas Photocell rau Arduino
- Kauj Ruam 5: Txuas rau Arduino
- Kauj Ruam 6: Pib Koj Li Code
- Kauj Ruam 7: Teeb Meem
- Kauj Ruam 8: Void Loop
- Kauj Ruam 9: Hloov Xim
- Kauj Ruam 10: Kawg RGB LED Code
- Kauj Ruam 11: Tshawb Tawm Teeb
- Kauj ruam 12: Troubleshooting
- Kauj Ruam 13: Cov Khoom Kawg
Video: Xim Hloov LED: 13 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:24
Kuv tau ua lub luag haujlwm los tsim cov qauv uas siv qee qhov kev ntsuas los tsim cov zis. Kuv txiav txim siab siv lub photocell, uas ntsuas qhov pom kev ntawm lub teeb nyob ib puag ncig, thiab RGB LED ua qhov tso tawm. Kuv paub kuv xav koom nrog LED lub peev xwm los tso tawm ntau yam xim, vim tias kuv xav tias nws yuav muaj kev lom zem. Yog tias kuv tuaj yeem tsim yam khoom twg kuv xav tau, kuv xav tias kuv yuav zoo li nws muaj xim zoo li ua tau.
Kwv yees Tus Nqi:
$ 37 - Elegoo Super Starter kit (suav nrog txhua yam khoom siv)
$ 53 - Yuav kom yuav txhua yam khoom siv ib tus zuj zus
Kev Pab Txuas:
RGB LED - Cov
create.arduino.cc/projecthub/muhammad-aqib…
Photocell - Cov
create.arduino.cc/projecthub/MisterBotBreak/how-to-use-a-photoresistor-46c5eb
Arduino Software - NPE
www.arduino.cc/en/software
Elegoo Super Start cov khoom siv -
www.amazon.com/gp/product/B01D8KOZF4/ref=p…
Khoom siv
- 1 RGB LED
- 1 photocell (aka photoresistor)
- 1 Arduino UNO pawg thawj coj
- 1 daim ntawv qhia zaub mov
- 1 USB cable rau Arduino
- 7 jumper xov hlau
-3 220 ohm resistors
-11 10k ohm resistor
- Arduino software (rub tawm dawb)
Yeem yeem
- khub ntawm rab koob lub qhov ntswg
Kauj Ruam 1: Teeb LED ntawm Breadboard
Ua ntej RGB LED yuav tsum tau teeb tsa kom raug ntawm lub khob cij
Tso lub LED nrog txhua ntawm plaub ceg hauv cais qhov ntawm tib kab (qhia los ntawm cov ntawv). Cov ceg ntev tshaj plaws yuav tsum yog ob txhais ceg los ntawm sab saud.
Hauv kab (qhia los ntawm tus lej) ntawm ceg ntev tshaj plaws, ntsaws rau hauv ib qho kawg ntawm cov xov hlau jumper.
Rau txhua ntawm peb tus ceg luv dua, tso ib qho 220 ohm resistor. Txhua tus tiv thaiv yuav tsum muaj ob txhais ceg nyob hauv kab ib yam li LED ob txhais ceg. Nov yog qhov uas kuv yuav siv rab rab qhov ntswg, vim tias ob txhais ceg ntawm cov neeg tawm tsam tuaj yeem nyuaj rau ntsaws los ntawm txhais tes.
Txuas peb lub xov hlau jumper ntawm ib sab ntawm tus tiv thaiv rov qab rau LED. Rau peb kab no, yuav tsum muaj ib lub xaim xaim hluav taws xob, ib tus tiv thaiv, thiab ib sab ntawm LED.
Kauj Ruam 2: Teeb LED ntawm Arduino
Tam sim no tias LED tau teeb tsa kom raug ntawm lub khob cij, nws yuav tsum tau txuas nrog Arduino.
Thawj jumper xaim txuas nrog cov ceg ntev tshaj plaws (yuav tsum yog kab thib ob ntawm LED) xav tau txuas nrog hauv av, qhia los ntawm "GND" ntawm Arduino.
Lwm peb lub xov hlau txuas, nyob rau qhov kev txiav txim qis, yuav tsum tau ntsaws rau hauv cov chaw nres nkoj 11, 10, thiab 9. Cov xaim nyob rau kab saum toj kawg nkaus yuav tsum txuas nrog 11, cov xaim txuas tom ntej (yuav tsum yog kab thib peb) txuas rau 10, thiab cov xaim kawg txuas mus rau 9. Cov xov hlau no peb yuav tsum khiav mus ib txhis thiab tsis txhob sib tshooj.
Kauj Ruam 3: Teeb Duab Photocell ntawm Breadboard
Txhawm rau kom LED hnov mob rau ib puag ncig qhov ci ntsa iab, nws yuav tsum tau txais cov ntaub ntawv los ntawm lub ntsuas cua.
Plug lub photocell rau hauv lub khob cij nrog ob txhais ceg hauv tib kab ntawv, zoo ib yam li LED tau ntsaws rau hauv.
Txuas lub 10k ohm resistor nrog ib txhais ceg hauv kab ib yam li hauv qab ceg ntawm daim duab. Txuas ob txhais ceg ntawm tus tiv thaiv kom deb dua hauv tib kab ntawv.
Kauj Ruam 4: Txuas Photocell rau Arduino
Plug rau hauv ib lub xaim hlau nyob hauv kab ib yam li 10k ohm resistor, tab sis tsis nyob hauv tib kab kab ntawv photocell.
Txuas lwm qhov kawg ntawm cov xov hlau txuas rau hauv av (GND) ntawm Arduino.
Plug rau hauv ob lub xov hlau sib txawv, ib qho hauv kab ib yam li txhua tus ntawm cov duab photocell.
Txuas cov xaim hluav taws xob mus rau qhov siab tshaj plaws rau hauv 5V chaw nres nkoj ntawm Arduino.
Txuas cov xaim hluav taws xob mus deb tshaj plaws hauv qab mus rau A0 chaw nres nkoj ntawm Arduino.
Kauj Ruam 5: Txuas rau Arduino
Tam sim no tias daim ntawv qhia zaub mov tau teeb tsa thiab txuas nrog Arduino, siv USB txuas los txuas Arduino rau koj lub khoos phis tawj.
Kauj Ruam 6: Pib Koj Li Code
Siv Arduino program, tsim cov duab kos tshiab.
Hauv kev tawm lus, sau koj lub npe, qee cov ntsiab lus hais txog daim duab, thiab txuas ib qho peev txheej uas koj tau siv.
Saum toj no qhov tsis muaj teeb tsa, tsim kom muaj kev hloov pauv thoob ntiaj teb. Xav tias dawb los theej thiab paste cov cai hauv qab no. Thaum koj sau cov cai, qee qhov yuav dhau los ua xim sib txawv. Qhov no yuav tsum tshwm sim.
int red_light_pin = 11; int ntsuab_light_pin = 10; int blue_light_pin = 9; int photocellReading = 0; int photocell = 5;
Yog tias koj pom, cov lej uas tau muab rau cov kev hloov pauv no sib haum nrog qhov twg cov xov hlau tau txuas rau ntawm Arduino board.
Kauj Ruam 7: Teeb Meem
Tsim kom muaj RGB LED raws li qhov tso tawm.
pinMode (red_light_pin, OUTPUT); pinMode (ntsuab_light_pin, OUTPUT); pinMode (blue_light_pin, OUTPUT);
Pib ua tus saib xyuas txuas ntxiv txhawm rau saib qhov nyeem ntawm lub photocell.
Serial.begin (9600); Serial.println ("Serial saib tau pib"); ncua (500); Serial.println ("."); ncua (500); Serial.println ("."); ncua (500); Serial.println ("."); ncua (500);
Xyuas kom tseeb tias qhov tsis muaj teeb meem teeb tsa muaj nyob hauv ib khub ntawm cov zawm hniav {}
Kauj Ruam 8: Void Loop
Sau cov cai rau qhov khoob khoob ntu.
Cov cai nyob hauv thawj daim duab luam tawm cov ntawv nyeem ntawm lub photocell ntawm kab sib cais. Qhov no ua kom yooj yim nyeem.
int tus nqi = analogRead (A0); photocellReading = analogRead (photocell); Serial.println (photocellReading); ncua (40);
Cov cai hauv daim duab thib ob yog qhov sib xws ntawm qee qhov kev nyeem ntawv rau xim dab tsi LED yuav tso tawm.
yog (photocellReading 0) {RGB_color (255, 0, 0); // Liab} yog (photocellReading 99) {RGB_color (255, 255, 0); // Daj} yog (photocellReading 199) {RGB_color (0, 255, 0); // Ntsuab} yog (photocellReading 299) {RGB_color (0, 0, 255); // Xiav} yog (photocellReading 399) {RGB_color (255, 0, 255); // Magenta}
Hloov tus lej tus lej ntawm RGB_color (0s thiab 255s) yuav hloov xim dab tsi. Cov no yog cov xim kuv tau mus nrog, tab sis xav tias hloov pauv lossis hloov lawv ib puag ncig raws li koj xav tau.
Txheeb xyuas ob zaug tias ntu ntu tsis muaj qhov nyob hauv ib khub ntawm cov zawm hniav {}
Kauj Ruam 9: Hloov Xim
Nov yog qee qhov xim ntxiv los xaiv los ntawm cov kauj ruam dhau los. Kuv siv cov cai no siv rau kuv daim duab.
Kauj Ruam 10: Kawg RGB LED Code
Qhov kawg ntawm daim duab, sab nraum qhov tsis muaj qhov seem ntu, ntxig cov cai no los txiav txim qhov chaw nres nkoj ntawm Arduino sib txuas lus tus nqi teeb liab, tus nqi lub teeb ntsuab, thiab lub teeb ntsuab.
tsis muaj dab tsi RGB_color (int red_light_value, int ntsuab_light_value, int blue_light_value) {analogWrite (red_light_pin, red_light_value); analogWrite (ntsuab_light_pin, ntsuab_light_value); analogWrite (blue_light_pin, blue_light_value); }
Ib yam li nrog qhov tsis muaj teeb tsa teeb tsa thiab tsis muaj seem ntu ntu, nco ntsoov tias ntu no muaj nyob hauv ib khub ntawm cov zawm hniav {}
Kauj Ruam 11: Tshawb Tawm Teeb
Tshaj tawm cov cai rau Arduino board los ntawm nias lub pob upload hauv qhov program. Yog tias koj ua nws raug, LED yuav tsum tso saib xim nyob ntawm seb muaj teeb pom kev ntau npaum li cas nyob ib puag ncig.
Liab yog qhov tsaus ntuj ib puag ncig, qhov qis tshaj ntawm kev nyeem ntawv.
Daj yog qhov ci dua me ntsis ib puag ncig/nyeem ntawv photocell siab dua. Nws zoo li teal hauv daim duab, tab sis nws ci daj rau tus kheej.
Peb xim tom ntej, ntsuab, xiav, thiab magenta, txhua yam sib xws nrog kev nyeem ntawv ntau dua los ntawm daim duab.
Kauj ruam 12: Troubleshooting
Yog tias cov xim tsis hloov pauv, lossis nws yuav siv qhov hloov pauv ntau heev rau cov xim hloov pauv, txheeb xyuas cov ntawv nyeem hauv daim duab saib. Txhua qhov ib puag ncig muaj qib sib txawv ntawm lub teeb, yog li nws yog qhov tseem ceeb rau txoj cai los cuam tshuam qhov ntawd.
Nyem rau Cov Cuab Yeej nyob rau sab saum toj ntawm Arduino program -> Nyem rau ntawm Serial Monitor.
Lub qhov rai yuav tsum tshwm tuaj uas qhia txog cov npe tsis tu ncua. Kho cov lej ntawm cov lus yog los ntawm Void Loop kauj ruam.
Kauj Ruam 13: Cov Khoom Kawg
Los ntawm kev ua txhua yam ntawm cov theem no, koj yuav tsum xaus nrog lub teeb uas hloov xim nyob ntawm qhov ci ntawm ib puag ncig.
Rau kuv, nyob rau nruab nrab qhov ci ntawm kuv chav, lub teeb ci ntsuab, tab sis kuv tuaj yeem hloov xim tau yooj yim los ntawm kev npog lub photocell lossis nce ntau npaum li cas lub teeb muaj.
Pom zoo:
Lub Rooj Kub: Tsim Kom Muaj Xim Hloov Hloov Lub Cev Kub: 7 Kauj Ruam (nrog Duab)
Lub Rooj Kub: Tsim Cov Xim Hloov Pauv Kub Cushion: Xav kom koj tus kheej toasty thaum lub caij ntuj no txias? Lub Rooj Kub yog txoj haujlwm uas siv ob qhov zoo tshaj plaws e -textile muaj peev xwm - hloov xim thiab cua sov! Peb yuav tsim lub rooj zaum hauv ncoo uas sov dua, thiab thaum nws npaj txhij mus nws yuav qhia tawm
MESOMIX - Automated Xim Xim Xim Tshuab: 21 Cov Kauj Ruam (nrog Duab)
MESOMIX - Automated Xim Xim Xim Tshuab: Koj puas yog tus tsim qauv, tus kws kos duab lossis tus neeg muaj tswv yim uas nyiam tha xim rau ntawm koj daim ntaub, tab sis feem ntau nws nyuaj thaum nws los ua qhov ntxoov ntxoo uas xav tau. uas tawm tsam rau huab cua nyias. Raws li cov cuab yeej no, koj
Cov xim pleev xim ntau xim (Kov Rhuav): 8 Kauj Ruam (nrog Duab)
Cov xim pleev xim ntau xim (Kov Rhuav): Teeb duab yog cov txheej txheem thaij duab siv los tsim cov teebmeem tshwj xeeb ntawm qhov kaw qhov nrawm. Lub teeb nyem feem ntau yog siv rau "xim" cov duab. Hauv Cov Lus Qhia no, Kuv yuav qhia koj yuav ua li cas txhawm rau tsim txhua yam hauv ib tus kws pleev xim nrog kov
Yuav Ua Li Cas LED Sawb Xim Hloov Hloov Circuit: 6 Cov Kauj Ruam
Yuav Ua Li Cas LED Sawb Xim Hloov Hloov Circuit: Hii phooj ywg, Hnub no kuv yuav ua ib qho kev hloov pauv ntawm LED Sawb xim hloov pauv.Let's pib
Cov Xim Ntau Yam Xim Stencils Nrog Cov Hloov Pauv Hloov: 12 Cov Kauj Ruam (nrog Duab)
Comprehensive Multi Color Stencils With Variable Output: Multilayer xim tiag tiag stenciling tsis yog txhua qhov sai thiab yooj yim. Tseeb, koj tuaj yeem crank ib zaug hauv ib teev, tab sis nws siv sijhawm thiab xyaum ua kom muaj peev xwm rov ua cov txheej txheem thiab paub yuav ua li cas txhawm rau nws rau txhua qhov sib txawv stencil. Hauv cov lus qhia no, Kuv yuav