Cov txheej txheem:

Arduino Ws2812 LED lossis Neopixel Led Sawb lossis Ntiv Nplhaib Qhia: 4 Kauj Ruam
Arduino Ws2812 LED lossis Neopixel Led Sawb lossis Ntiv Nplhaib Qhia: 4 Kauj Ruam

Video: Arduino Ws2812 LED lossis Neopixel Led Sawb lossis Ntiv Nplhaib Qhia: 4 Kauj Ruam

Video: Arduino Ws2812 LED lossis Neopixel Led Sawb lossis Ntiv Nplhaib Qhia: 4 Kauj Ruam
Video: Scott's LED Array 2024, Hlis ntuj nqeg
Anonim
Image
Image
Sau Koj Cov Cheeb Tsam
Sau Koj Cov Cheeb Tsam

Hauv cov lus qhia no peb yuav kawm paub siv neopixel lossis ws 2812 lossis coj nrawm nrog Arduino. Qhov hom LED lossis sawb lossis ntiv nplhaib raug tswj los ntawm ib tus pin Vin nkaus xwb thiab txhua tus LEDs yog tus kheej hais tau yog li cov no tseem hu ua tus neeg nyob LEDs thiab lawv raug nqi ntau dua li ib txwm RGB LED.

Kauj Ruam 1: Sau Koj Cov Cheeb Tsam

YUAV TSUM MUAJ: MUAJ ARDUINO UNO:

www.utsource.net/itm/p/7199843.html

MUAJ WS2812 LED:

MUAJ WS2812 LED Nplhaib:

www.utsource.net/itm/p/8673715.html

////////////////////////////////////////////////////////////////////////

yog li thawj zaug koj yuav tsum tau txais ob qho tseem ceeb ib qho ntawm lawv yog arduino thiab lwm qhov yog neopixel ws2812 LEDs / coj sawb lossis lub nplhaib.

Cov Khoom Yuav Yuav (koom nrog txuas) -

Arduino UAS-

www.banggood.com/UNO-R3-ATmega16U2-AVR-Mod…

Ws2812 neopixel (12 ntsis) ntiv nplhaib -

www.banggood.com/3Pcs-CJMCU-12-Bit-WS2812-…

www.banggood.com/CJMCU-12-Bit-WS2812-5050-…

Ws2812 neopixel (7 ntsis) ntiv nplhaib-

www.banggood.com/5Pcs-CJMCU-7-Bit-WS2812-5…

www.banggood.com/3Pcs-CJMCU-7-Bit-WS2812-5…

Ws2812 neopixel (3 ntsis) ntiv nplhaib -

www.banggood.com/5pcs-CJMCU-3bit-WS2812-RG…

www.banggood.com/CJMCU-3bit-WS2812-RGB-LED…

Ws2812 neopixel coj sawb -

www.banggood.com/AUDEW-1M4M5M-RGB-SMD5050-…

www.banggood.com/4-PCS-WS2812-5V-Taillight…

www.banggood.com/0_5M1M2M3M4M5M-DC5V-USB-R…

www.banggood.com/0_5M1M2M3M4M5M-USB-RGB-50…

www.banggood.com/0_5M1M2M3M4M5M-DC5V-USB-R…

Kauj ruam 2: Kev sib txuas

Kev sib txuas
Kev sib txuas

kev sib txuas yog yooj yim heev. txhua yam koj yuav tsum ua yog txuas vcc ntawm neopixel mus rau +5v & Gnd ntawm neopixel mus rau Gnd & Vin tus pin ntawm neopixel rau ib tus lej digital (kuv txuas nws rau tus pin 6 vim tias peb yuav txhais tus pin 6 hauv software.).

IIf muaj teeb meem hauv kev sib txuas ces xa cov vis dis aus rau kev pab.

Kauj ruam 3: Programming

Programming
Programming

Qhib Arduino IDE tom qab ntawd mus rau cov piv txwv & mus rau "neopixel" tom qab ntawv qhib "yooj yim" kos duab.

Hauv daim duab kos koj yuav tsum teeb ob yam ua ntej

1- txheeb tus lej PIN 6 (Koj yuav tsum txhais tus lej tsis muaj ntawm arduino uas Vin tus pin ntawm neopixel txuas nrog, peb siv tus lej 6 ntawm no)

2- txhais NUMPIXELS 12 (koj yuav tsum txhais tsis muaj pixels koj neopixel muaj uas txhais tau tias tsis muaj LED ntawm nws, peb muaj 12 LEDs ntawm peb neopixel yog li peb yuav siv 12)

Thiab hauv ntu ntu muaj ib qho lus txib tau siv los teeb xim ntawm neopixel

pixels.setPixelsColor (i, pixels. Color (r, g, b));

Qhov twg "kuv" yog tus lej pixel lossis coj koj xav tig rau hauv ib qho xim twg

& "r" "g" "b" yog xim xim uas yog RED, GREEN, BLUE & lawv tus nqi ntau yog 0 txog 255.

Yog li ntawm no peb siv

pixels.setPixelsColor (0, pixels. Color (0, 0, 255);

Qhov no txhais tau tias thawj pixel tau teeb rau xim xiav.

Kauj ruam 4: Upload Code

Image
Image
Rub tawm Txoj Cai
Rub tawm Txoj Cai

Kauj ruam kawg yog xa cov cai rau Arduino & koj tau ua tiav & yog tias koj ua txhua yam raug lawm ces neopixel yuav qhib raws li lub tswv yim koj tau muab.

Thiab yog tias muaj teeb meem nrog ib qib twg thov mus saib hauv video.

Txaus siab rau koj neopixel.

Pom zoo: