Cov txheej txheem:

Hloov 3 Lub Txhab Nyiaj Txiag ntawm LEDs Nrog Ib Hloov thiab Visuino: 9 Cov Kauj Ruam (nrog Duab)
Hloov 3 Lub Txhab Nyiaj Txiag ntawm LEDs Nrog Ib Hloov thiab Visuino: 9 Cov Kauj Ruam (nrog Duab)

Video: Hloov 3 Lub Txhab Nyiaj Txiag ntawm LEDs Nrog Ib Hloov thiab Visuino: 9 Cov Kauj Ruam (nrog Duab)

Video: Hloov 3 Lub Txhab Nyiaj Txiag ntawm LEDs Nrog Ib Hloov thiab Visuino: 9 Cov Kauj Ruam (nrog Duab)
Video: Martin ngatia подробно описывает стратегию Крау о постоянном прекращении коррупции в кении... 2024, Hlis ntuj nqeg
Anonim
Hloov 3 Lub Tsev txhab nyiaj ntawm LEDs nrog Ib Hloov thiab Visuino
Hloov 3 Lub Tsev txhab nyiaj ntawm LEDs nrog Ib Hloov thiab Visuino

Txoj haujlwm no tau tawm los ntawm kev sim uas kuv xav sim, Kuv xav pom ntau npaum li cas lub teeb UV xav tau kom pom ntau feem ntawm cov nqi nyiaj daus las thiab kev txheeb xyuas kev nyab xeeb. Kuv tau tsim lub tsev tawg no thiab xav qhia cov lus qhia no ntawm no.

Yam uas koj xav tau:

#1 Ib qho Arduino Nano lossis pawg thawj coj zoo ib yam [txawm tias UNO yuav ua haujlwm, ib yam loj rau qhov haujlwm no]

#2 Ib qho txheej txheem me me ntawm lub khob cij, 720 tus pin zoo.

#3 3 teeb ntawm LEDs zoo sib xws, txhua txheej yuav tsum muaj qhov tshwj xeeb tshwj xeeb, kom deb li qhov Voltage thiab resistors xav tau. [Kuv siv 6, 3mm UV thiab 3, 5mm UV rau kuv, tab sis koj tuaj yeem siv ib qho uas koj muaj ntawm tes.]

#4 9 resistors sib phim rau koj li LED xav tau tam sim no.

#5 Kev hloov pauv ib ntus, los ntawm 37 hauv 1 cov khoom siv ntsuas qhov ntsuas lossis ib txwm uas koj tuaj yeem teeb tsa kom nws siv 3 xaim.

#6 Kab ntawm cov xov hluav taws xob luv luv. [Kuv siv daj, txiv kab ntxwv, liab thiab dub]

#7 Visuino qhov Visual Programming program los ntawm Boian Mitov ntxiv rau Arduino IDE

Kauj Ruam 1: Teeb cov LEDs thiab Cov Tiv Thaiv …

Teeb cov LEDs thiab Cov Tiv Thaiv…
Teeb cov LEDs thiab Cov Tiv Thaiv…
Teeb cov LEDs thiab Cov Tiv Thaiv…
Teeb cov LEDs thiab Cov Tiv Thaiv…

Hauv thawj qib no, peb yuav teeb tsa LEDs thiab Cov Tiv Thaiv. Muab koj LEDs nrug deb ntawm qhov koj xaiv Arduino board yuav yog thiab li ntawm 1 lossis 2 qhov los ntawm ib leeg, kom tawm ntawm qhov chaw yooj yim nyob nruab nrab ntawm lawv. Saib Duab 1.

Tom ntej no, tso koj cov neeg tiv thaiv yog li ib qho kawg tau daig hauv GND txoj kev tsheb nqaj hlau thiab tom qab ntawd lwm qhov raug muab tso rau hauv lub qhov rau tus pin cathode ntawm LED. Siv daim duab 2. [Kuv tso lub jumper txuas rau lub khob cij 2 GND ntsia ua ke.]

Kauj Ruam 2: Teeb Lub Teeb …

Kev teeb tsa cov kab…
Kev teeb tsa cov kab…
Kev teeb tsa cov kab…
Kev teeb tsa cov kab…
Kev teeb tsa cov kab…
Kev teeb tsa cov kab…
Kev teeb tsa cov kab…
Kev teeb tsa cov kab…

Ua ntej tshaj plaws, rau cov kauj ruam no yog txuas 2 GND xov hlau los ntawm Nano mus rau hauv av rau ntawm ob sab ntawm lub khob cij. Koj tuaj yeem siv GND ntawm ob sab ntawm koj xaiv Arduino hom board, Kuv tsuas yog siv tib qho rau ob qho tib si ntawm kuv. Daim duab 1 & 2

Thov nco ntsoov tias Cov av hauv av ntawm koj lub khob cij yuav nyob sib txawv me ntsis.

Ntawm Daim Duab 3 Kuv tau pib ntsaws rau hauv 3 lub txhab nyiaj sib txawv ntawm LEDs rau hauv 3 Digital Pins, tus lej 2, 3 thiab 4. Cov xov hlau daj tau txuas rau Pin 2 thiab txuas rau cov LEDs uas nyob deb tshaj ntawm Nano. Tus Pin 3 xov hlau yog Txiv kab ntxwv thiab txuas mus rau nruab nrab teeb ntawm LEDs thiab Cov xov hlau liab txuas mus rau LEDs ze tshaj plaws thiab txuas nrog Pin 4. Daim duab 4 qhia txog kev sib txuas ntawm sab zoo ntawm lub khob cij.

Kauj Ruam 3: Txuas Tus Hloov [siv rau Hloov Lub Xeev ntawm LEDs] …

Txuas lub Hloov [siv rau Hloov Lub Xeev ntawm LEDs]…
Txuas lub Hloov [siv rau Hloov Lub Xeev ntawm LEDs]…
Txuas lub Hloov [siv rau Hloov Lub Xeev ntawm LEDs]…
Txuas lub Hloov [siv rau Hloov Lub Xeev ntawm LEDs]…
Txuas lub Hloov [siv rau Hloov Lub Xeev ntawm LEDs]…
Txuas lub Hloov [siv rau Hloov Lub Xeev ntawm LEDs]…

Ntawm kuv qhov kev hloov pauv, hauv Daim Duab 1, Lub Teeb liab thiab Qhov Tsis Zoo yog qhia rau sab laug thiab sab xis, feem, yog li qhov nruab nrab txuas yog Qhov Zoo. Cov xaim dub tau txuas nrog GND kev tsheb nqaj hlau nyob rau sab saud ntawm Nano thiab Cov Hlau Dawb tau txuas rau hauv 3.3V Pin ntawm Nano, thaum cov xim av xim hlau mus rau Digital Pin 10. Raws li pom hauv daim duab 2 thiab 3.

Kauj Ruam 4: Teeb Duab Sketch hauv Visuino …

Teeb tsa Sketch hauv Visuino…
Teeb tsa Sketch hauv Visuino…
Teeb tsa Sketch hauv Visuino…
Teeb tsa Sketch hauv Visuino…
Teeb tsa Sketch hauv Visuino…
Teeb tsa Sketch hauv Visuino…

Yog li, hauv thawj Visuino Kauj Ruam no koj yuav tsum qhib Visuino lossis rub tawm nws los ntawm no: Visuino.com thiab nruab nws ib zaug ntawm qhov screen hais kom ua.

Tom ntej, hauv lub qhov rai loj, koj yuav tsum xaiv Arduino cov laug cam sib xws uas koj yuav siv rau txoj haujlwm no. Daim duab 1 qhia tias kuv tau xaiv Nano ces nyem "OK"

Tom qab ntawd koj yuav xav mus rau Tshawb nrhiav lub thawv nyob rau sab saud sab xis thiab ntaus hauv 'tab sis' thawj ntu ntawm lo lus, 'khawm' Daim duab 2 qhia qhov tshwm sim ntawm kev tshawb fawb no. Luag lub khawm tivthaiv mus rau sab laug ntawm Arduino board thiab tso nws tseg raws li qhia hauv daim duab 3.

Tom ntej no, tshawb rau 'txee' hauv tib lub npov tshawb fawb saum cov khoom sib txuas, thiab rub tus qauv ntsuas tsis muaj + thiab - ntawm nws, [Daim duab 4] rau koj lub qhov rai tseem ceeb tsuas yog sab xis ntawm lub pob. Saib daim duab 5.

Tom qab ntawd, koj yuav rub qhov txuas txuas los ntawm Khawm Tawm mus rau Counter In. Raws li qhia hauv daim duab 6.

Kauj Ruam 5: Teeb Duab Sketch hauv Visuino … [txuas ntxiv]

Teeb Cov Duab Sketch hauv Visuino… [txuas ntxiv]
Teeb Cov Duab Sketch hauv Visuino… [txuas ntxiv]
Teeb Cov Duab Sketch hauv Visuino… [txuas ntxiv]
Teeb Cov Duab Sketch hauv Visuino… [txuas ntxiv]
Teeb Cov Duab Sketch hauv Visuino… [txuas ntxiv]
Teeb Cov Duab Sketch hauv Visuino… [txuas ntxiv]

Hauv cov kauj ruam no, peb yuav txuas ntxiv cov khoom ib tus zuj zus, tom ntej no yuav yog tus txiav txim siab, yog li hauv lub thawv tshawb fawb hom hauv 'decoder' thiab tsuas muaj ib qho kev xaiv, hauv 2 pawg sib txawv, Duab 1. Luag nws mus rau sab xis ntawm lub txee yog li cov pins taw tes rau kab, raws li qhia hauv daim duab 2. Hauv daim duab 3 koj tuaj yeem pom kom rub tus txuas, los ntawm lub txee rau lub cim txiav txim siab.

Tam sim no koj xav ntxiv qee qhov 'pins tso tawm' rau nws rau qib sib txawv ntawm khawm. Hloov tus lej ua ntej mus rau '5' hauv lub Qhov rai Properties thiab coj mus rhaub "Enter" qhov tseem ceeb ntawm koj cov keyboard kom teeb nws zoo li hauv Daim Duab 4. Tam sim no koj tuaj yeem pom tias cov pins tau ntxiv rau hauv Daim Duab 5.

Kauj Ruam 6: Teeb Duab Sketch hauv Visuino … [txuas ntxiv]

Teeb Cov Duab Sketch hauv Visuino… [txuas ntxiv]
Teeb Cov Duab Sketch hauv Visuino… [txuas ntxiv]
Teeb Cov Duab Sketch hauv Visuino… [txuas ntxiv]
Teeb Cov Duab Sketch hauv Visuino… [txuas ntxiv]
Teeb Cov Duab Sketch hauv Visuino… [txuas ntxiv]
Teeb Cov Duab Sketch hauv Visuino… [txuas ntxiv]

Cov tivthaiv tom ntej no peb yuav ntxiv yog OR tus neeg ua haujlwm, yog li tshawb rau 'boolean' los ntawm kev ntaus 'boo' Daim Duab 1 thiab rub lub OR tivthaiv mus rau sab xis ntawm tus txiav suab. Tom qab ntawd peb yuav xav tau 2 ntxiv, yog li rub cov hauv qab no thawj zaug, raws li pom hauv Daim Duab 2. Tom ntej no, Luag qhov kev sib txuas los ntawm Pin [1] ntawm Decoder rau Pin [0] ntawm OR1 Cheeb Tsam, saib daim duab 3, thiab mus txuas ntxiv los rub tus Pin [2] los ntawm tus lej cim rau Pin [0] ntawm OR2 thiab tom qab ntawd Pin [3] rau Pin [0] ntawm OR3, thov saib daim duab 4.

Tam sim no koj yuav ua qhov sib txuas los ntawm LOSSIS cov khoom siv rau Nano (lossis pawg twg uas koj tab tom siv). Yog li, Luag txuas los ntawm Outs ntawm ORs mus rau Pins 2, 3 & 4, raws li pom hauv Daim Duab 5. Nyob rau theem no, koj muaj daim duab kos ua haujlwm, koj tuaj yeem kwv yees nws yuav ua li cas yog tias koj tso tam sim no thiab nias lub pob ?

Nres ntawm no sim nws rau koj tus kheej

Saib Kauj Ruam tom ntej rau cov lus teb

Kauj Ruam 7: Kev sim ib nrab ntawm txoj haujlwm…

Kev sim ib nrab ntawm txoj haujlwm…
Kev sim ib nrab ntawm txoj haujlwm…

Yog li, koj puas tau sim qhov no, yog tias koj tau ua tiav pom tias lub pob nyem tau qhib rau LED teeb rau txhua qhov ntawm thawj 3 nias thiab tus thib plaub tsis tshwm sim los ua dab tsi, dua li tig qhov kawg tawm.

Hauv cov kauj ruam hauv txoj haujlwm, kuv yuav piav qhia dab tsi tshwm sim. Tus Decoder muaj 5 txoj haujlwm rau khawm, thawj tus [0] yog txhua yam tawm thiab yog qhov chaw pib. Tom ntej 3 txhua qhov tig rau ib txheej ntawm LEDs thiab qhov thib tsib (Output 4), uas zoo li tsis ua dab tsi, tam sim no, yuav tau teeb tsa kom tig tag nrho.

Kauj Ruam 8: Ua tiav Hauv Visuino…

Ua tiav hauv Visuino…
Ua tiav hauv Visuino…
Ua tiav Hauv Visuino…
Ua tiav Hauv Visuino…
Ua tiav hauv Visuino…
Ua tiav hauv Visuino…

Tam sim no tsuas yog ua kom tiav qhov kev kos duab no, koj yuav tsum ua kom tiav Circuit Court rau ORs uas peb tau ntxiv. Yog li, rub qee qhov kev sib txuas ua tus Pin [4] ntawm tus Decoder rau txhua tus ORs Pins [1] s, 3 ntawm lawv tag nrho. Saib Duab 1.

Tom ntej no, txuas lub tswv yim ntawm Khawm, rau Pin10 ntawm Arduino board. (Tus Pin no yog nyob ntawm koj, qhov ntawd tsuas yog qhov uas kuv txuas nrog nws) Duab 2 & 3.

Daim duab 4 qhia txog daim duab kos ua tiav thiab yog tias koj xav tau/xav saib xyuas Serial output ntawm Counter ces txuas cov ntawv ntawd rau Serial Input ib yam. Saib daim duab 5.

Kauj ruam 9: Ua tiav Video thiab Ua tiav

Image
Image

Tam sim no upload koj cov duab kos ntawm F9 Key hauv Visuino thiab tom qab ntawd rub mus rau lub rooj tsavxwm los ntawm Arduino IDE nrog CTRL+U. Tom qab ntawd koj yuav muaj qhov ua haujlwm ntawm qhov haujlwm no ib yam.

Ua si ib puag ncig nrog nws, kom pom dab tsi ntxiv koj tuaj yeem ntxiv txhawm rau txhim kho daim duab no, tom qab ntawv qhia rau kuv paub hauv Cov Lus.

Txaus siab rau !!

Pom zoo: