Cov txheej txheem:

Octarine: Kev Sib Tw Xim Xim Nrog WS2812 RGB LEDs: 6 Kauj Ruam
Octarine: Kev Sib Tw Xim Xim Nrog WS2812 RGB LEDs: 6 Kauj Ruam

Video: Octarine: Kev Sib Tw Xim Xim Nrog WS2812 RGB LEDs: 6 Kauj Ruam

Video: Octarine: Kev Sib Tw Xim Xim Nrog WS2812 RGB LEDs: 6 Kauj Ruam
Video: HOW TO EZ COUNTER MARS..!! Cancer Octarine Core Batrider Endless Fly by Yang 7.21c | Dota 2 2024, Hlis ntuj nqeg
Anonim
Octarine: Kev Sib Tw Xim Xim Nrog WS2812 RGB LEDs
Octarine: Kev Sib Tw Xim Xim Nrog WS2812 RGB LEDs

Octarine, xim ntawm khawv koob. Nws tau muaj txoj sia nyob thiab ci ntsa iab thiab nws yog cov xim tsis sib cav ntawm kev xav, vim tias nyob qhov twg nws tau tshwm sim nws yog lub cim qhia tias teeb meem tsuas yog tus tub qhe ntawm lub zog ntawm lub siab xav. Nws yog enchantment nws tus kheej.

Tab sis Rincewind ib txwm xav tias nws zoo li cov xim ntsuab-ntshav.

- Terry Pratchett - Xim Ntawm Khawv koob

Txhua cov xim tau ntxim nyiam thiab koj yuav tsum tso lawv ib leeg dhau ib qho. Peb qhov kev ua khawv koob yuav pab koj hauv koj qhov kev tshawb nrhiav.

PS Hauv qhov haujlwm no kuv siv ntau tus neeg ua haujlwm binary thiab lub ntsej muag binary, yog li nws yuav raug siv los ntawm Computer Science cov kws qhia rau lub hom phiaj ntawm Boolean kev qhia txog kev xav hauv kev lom zem.

Khoom siv

1x Arduino Nano/Uno lossis lwm lub rooj sib tham. Qhov haujlwm tiag tiag siv 5 tus lej digital thiab tsawg dua 6KB ntawm kev nco. Yog li Attiny85-pawg thawj coj yuav tsum ua haujlwm zoo.

4 x tactile khawm. Yog tias koj xav tau, koj tuaj yeem siv cov khawm sensor hloov.

1x WS2812 LED sawb lossis bar nrog 8 tswj RGB LEDs.

1x daim ntawv qhia zaub mov lossis PCB pawg thawj coj saib yog tias koj xav tau.

Breadboard Jumper Wires.

Kauj Ruam 1: Cov Cai Game

Kev Cai Ua Si
Kev Cai Ua Si

Qhov kev ua si sib tham muaj 8 RGB LEDs. Lub hom phiaj yog ua kom lawv txhua tus ci nrog tib xim. Nws yog liab hauv thawj "ntiaj teb", txiv kab ntxwv hauv ob, daj thib peb, thiab lwm yam.

Muaj 3 lub ntsiab khawm. Txhua tus ntawm lawv hloov xim ntawm plaub LEDs raws li daim npog ntsej muag binary. Piv txwv li, thawj lub khawm muaj daim npog 11110000. Nws txhais tau tias nws hloov xim ntawm thawj plaub LEDs. Kuj tseem muaj "Shift" khawm uas hloov lub ntsej muag. Yog tias tus neeg siv nyem Shift+Thawj lub pob, lub npog ntsej muag yuav yog 00001111 thiab plaub qhov kawg LEDs yuav raug cuam tshuam. Cov xim tau hloov pauv ib ntus.

Cov duab txuas nrog piav qhia txhua daim npog qhov ncauj.

Kauj Ruam 2: Qib Tsim

Qib Tsim
Qib Tsim

Qhov kev ua si suav nrog "ntiaj teb" yim sublevels txhua. Thawj lub ntiaj teb yog "Liab", thiab tag nrho cov LEDs ntawm no yuav nyob hauv ob lub xeev xwb: dawb thiab liab. Hauv txhua sublevel ntau cov kauj ruam sib dhos tau thov, yog li qhov nyuaj nce maj. Thaum koj hla lub ntiaj teb (piv txwv li txhua qib qis), koj cawm xim tom ntej. Yog li hauv qhov thib ob ("Txiv kab ntxwv") ntiaj teb txhua lub LEDs muaj peb lub xeev: dawb paug, liab thiab txiv kab ntxwv. Ntawd yog hais, txhua lub ntiaj teb tom ntej yog qhov nyuaj tshaj li yav dhau los.

Dab tsi tshwm sim hauv 8th ("Octarine") ntiaj teb … zoo … khawv koob dawb huv.

Kauj ruam 3: Circuit Court

Qhov Circuit
Qhov Circuit

Nws nyob ntawm pawg tswj hwm tshwj xeeb uas koj siv, tab sis kuv pom zoo kom siv lub zog hluav taws xob sab nraud rau LEDs.

Kuv siv tus pin 2, 3, 4, thiab 5 rau cov nyees khawm. Yog tias koj siv lwm lub microcontroller lossis pins tsis txhob hnov qab hloov kho nws hauv txoj haujlwm program.

Kauj ruam 4: Txoj Cai

Txoj Cai
Txoj Cai

Ntawm no koj yuav pom qhov tseeb version ntawm qhov chaws.

Kauj ruam 5: Xeem

Kev Xeem
Kev Xeem

Kauj Ruam 6: Yog li, Dab Tsi Ntxiv?

Yog li, Dab Tsi Ntxiv?
Yog li, Dab Tsi Ntxiv?

Koj yuav tau pom tias qhov kev ua si tsis muaj lub ntiaj teb thib 8 (Octarine). Nws tau ua txhob txwm ua. Khawv koob… tsis yog ib yam uas yuav tsum tau rov tsim dua.

Kuv txhawb koj kom tsim koj tus kheej lub ntiaj teb 8. Piv txwv li, koj tuaj yeem ua tus neeg ua si npaj cov xim zaj sawv xim hloov xim ib leeg lossis siv cov cell nrog hloov xim. Nws nyob ntawm koj. Ua koj tus kheej khawv koob hauv koj tus kheej txoj kev.

Pom zoo: