Cov txheej txheem:

Micro: ntsis Neopixel Taw Qhia: 6 Cov Kauj Ruam
Micro: ntsis Neopixel Taw Qhia: 6 Cov Kauj Ruam

Video: Micro: ntsis Neopixel Taw Qhia: 6 Cov Kauj Ruam

Video: Micro: ntsis Neopixel Taw Qhia: 6 Cov Kauj Ruam
Video: Txiaj ntsim niam cov kua mis _ Mab Sua Lis.mp4 2024, Hlis ntuj nqeg
Anonim
Micro: ntsis Neopixel Taw Qhia
Micro: ntsis Neopixel Taw Qhia

Cov lus qhia no yuav qhia qee yam yooj yim txog Neopixels thiab qhia siv lub tsev qiv ntawv Neopixel li cas. Neopixels yog txoj hauv kev zoo los coj lub teeb rau koj cov phiaj xwm, vim tias lawv pheej yig, siv tau yooj yim thiab micro: me ntsis tuaj yeem tswj hwm ntau ntawm lawv tib lub sijhawm.

Khoom siv

1 x Micro: ntsis

3 x Alligator-Alligator dhia hlua

Ib txoj hlua ntawm Neopixels (WS2812B).

Ib co xaim

Solder

Soldering hlau

Kauj ruam 1: Neopixel

Lub Neopixel
Lub Neopixel

Neopixels yog ib tus neeg tuaj yeem hais tau LED. Txhua tus muaj peb lub tswv yim. Lub zog, av thiab cov ntaub ntawv tawm tswv yim. Ntawm daim duab uas yog 5v, gnd thiab Din. Nws kuj muaj peb qhov kev tso tawm. Lub zog, av thiab cov ntaub ntawv tawm. Qhov twg dua yog 5v, gnd thiab Ua ntawm daim duab. Txij li txhua tus neopixel tuaj yeem xa cov ntaub ntawv, lub zog thiab hauv av mus rau tom ntej neopixel koj tuaj yeem daisy saw ntau neopixels ua ke thiab tswj lawv txhua tus nrog ib tus pin tawm thiab txhawb lawv los ntawm ib qho khoom siv hluav taws xob.

Thaum neopixel hais 5 volt, koj tuaj yeem ua haujlwm ntawm 3.3 volt, tab sis lawv xav tau qee lub zog, yog li koj yuav tsum tsis txhob sim ua lub zog rau ntau yam ncaj qha los ntawm koj lub micro: me ntsis. Yog li yog tias koj xav khiav ntau neopixels koj yuav tsum tsuas yog siv micro: me ntsis rau cov ntaub ntawv nkag, thaum koj tau txais lub zog los ntawm lwm qhov chaw. Ntawm no peb tsuas yog siv 3 neopixels, yog li txhawb nws los ntawm micro: ntsis tsis yog teeb meem.

Kauj Ruam 2: Npaj Neopixels

Npaj Neopixels
Npaj Neopixels
Npaj Neopixels
Npaj Neopixels

Ua ntej peb yuav txiav cov neopixel sawb kom peb tsuas muaj peb neopixels xwb. Neopixel sawb tuaj yeem txiav nruab nrab ntawm cov pixels. Yog tias koj saib thawj daim duab, tom qab ntawd daim kab xev tuaj yeem yog clip appart ntawm kab txaij dawb. Tsuas yog siv tus xaim hluav taws xob.

Kuv tau pom qee tus neeg tso cov kais dej ncaj qha rau ntawm neopixel LED strips, tab sis txij li kuv tau siv mus rau qhov siv cov kab luv luv no ob peb zaug kuv yuav txuas cov xov hlau rau nws. Peb xov hlau. Ib lub xaim ntsuab ntawm Din, xaim dub ntawm gnd thiab liab ntawm 5 v.

Kauj Ruam 3: Txuas Neopixel Sawb thiab Micro: ntsis

Peb siv cov nab kuab txuas los txuas lub neopixel rau micro: me ntsis.

Neopixel -> Micro: ntsis

Gnd -> Gnd

Din -> Pin 0

5 v -> 3.3 v

Kauj Ruam 4: Tau Txais Kev Txuas Ntxiv

Tau Txais Kev Txuas Ntxiv
Tau Txais Kev Txuas Ntxiv
Tau Txais Kev Txuas Ntxiv
Tau Txais Kev Txuas Ntxiv
Tau Txais Kev Txuas Ntxiv
Tau Txais Kev Txuas Ntxiv

Ua ntej koj mus rau Makecode editor thiab pib ua haujlwm tshiab. Tom qab ntawv koj mus rau "Advanced" thiab xaiv "Extensions". Nco ntsoov tias txij li kuv yog neeg Danish, cov nyees khawm no muaj cov npe sib txawv me ntsis hauv cov duab. Hauv kev txuas ntxiv koj tshawb rau "neopixel" thiab xaiv sab saud sab saud.

Kauj Ruam 5: Thawj Txoj Haujlwm

Thawj Txoj Haujlwm
Thawj Txoj Haujlwm
Thawj Txoj Haujlwm
Thawj Txoj Haujlwm

Kuv tseem yog neeg Danish, yog li kuv tus lej tsim ua lus Danish, tab sis koj tseem tuaj yeem pom qhov thaiv zoo li cas hauv cov lus Askiv.

Thawj qhov thaiv hauv "Thaum pib" (Ved pib) qhia rau micro: me ntsis tau nrhiav cov neopixel sawb thiab pes tsawg neopixels txuas nrog nws. Ntawm no peb txuas 3 neopixel rau tus pin 0.

Thaiv tom ntej teeb ci ci ntawm 0 txog 255. Peb teeb nws rau 30 uas tseem yog qhov ci heev.

Hauv lub voj voos tas mus li (Rau qhov siab) peb siv peb txoj hauv kev sib txawv los teeb LED xim.

Thawj ntu teeb tsa thawj LED kom liab. Nov yog txoj hauv kev yooj yim tshaj plaws los teeb xim, tab sis tsuas muaj 10 xim sib txawv los xaiv. Qhov thaiv no tsis ua rau pom cov xim ntawm LED sawb. Peb yuav tsum tau siv cov yeeb yam thaiv rau qhov ntawd.

Qhov thaiv thib ob teeb tsa xim thib ob ntawm LED raws li hue (Hom xim puag), saturation (Xim muaj zog npaum li cas) thiab ci ntsa iab (Yuav ua li cas ci lossis tsaus xim). Qhov no yuav yog qhov ci turkish xiav.

Qhov thaiv thib peb teeb tsa xim thib peb LED raws li ntau npaum li cas ntsuab, xiav thiab liab nyob hauv nws. Cov xim no yog ua los ntawm 80 ntsuab thiab 40 liab, uas ua rau peb muaj xim ntsuab tsaus.

Qhov kawg ntawm qhov thaiv ib txhis yog cov yeeb yam thaiv. Cov xim hloov peb tau ua yuav pib ua haujlwm thaum peb ua yeeb yam thaiv.

Txij li tsis muaj ib yam dab tsi hloov pauv hauv txoj haujlwm no peb tuaj yeem ua haujlwm tag nrho rau hauv "Thaum pib".

Nov yog txoj haujlwm.

Kauj Ruam 6: Qhov Kev Kawm Ob

Image
Image

Hauv qhov haujlwm thib ob peb tau tso tag nrho thawj qhov haujlwm rau hauv "Thaum Pib"

Ntawm khawm A nias (Når der trykkes på knappen A) peb siv qhov ua haujlwm pixel hais kom ua. Qhov no yuav txav tag nrho cov xim ntawm qib nce. Yog li qhov LED thib peb tau txais xim ntawm LED thib ob, LED thib ob tau txais xim ntawm thawj LED thiab nrog kev hloov pauv hais kom ua thawj LED yuav dhau mus dawb. Peb kuj tseem siv cov yeeb yam thaiv, vim tias tsis muaj cov yeeb yam thaiv LED yuav ua rau tsis hloov xim.

Ntawm khawm B nias (Når der trykkes på knappen B) peb siv cov lus tig pixel. Qhov no ua haujlwm zoo ib yam li kev hloov pauv cov lus txib pixel, tab sis hloov qhov thawj LED ua qhov khoob nws yuav siv cov xim ntawm LED kawg. Yog li qhov LED thib peb tau txais xim ntawm LED thib ob, LED thib ob tau txais xim ntawm thawj LED thiab nrog kev hais kom tig thawj LED yuav tau txais xim ntawm LED thib peb. Peb kuj tseem siv cov yeeb yam thaiv, vim tias tsis muaj cov yeeb yam thaiv LED yuav ua rau tsis hloov xim.

Ntawm lub pob A+B nias (Når der trykkes på knappen A+B). Thawj ntu luam tawm kwv yees siv lub zog Neopixels ntawm mico: ntsis. Qhov thaiv thib ob muab rau peb 2 thib ob los nyeem qhov kwv yees. Qhov thib peb thaiv ces tshem qhov screen.

Nov yog txoj haujlwm thib ob.

Pom zoo: