Cov txheej txheem:

Neopixel Ws2812 Zaj sawv LED Glow Nrog M5stick-C - Khiav Zaj sawv ntawm Neopixel Ws2812 Siv M5stack M5stick C Siv Arduino IDE: 5 Kauj Ruam
Neopixel Ws2812 Zaj sawv LED Glow Nrog M5stick-C - Khiav Zaj sawv ntawm Neopixel Ws2812 Siv M5stack M5stick C Siv Arduino IDE: 5 Kauj Ruam

Video: Neopixel Ws2812 Zaj sawv LED Glow Nrog M5stick-C - Khiav Zaj sawv ntawm Neopixel Ws2812 Siv M5stack M5stick C Siv Arduino IDE: 5 Kauj Ruam

Video: Neopixel Ws2812 Zaj sawv LED Glow Nrog M5stick-C - Khiav Zaj sawv ntawm Neopixel Ws2812 Siv M5stack M5stick C Siv Arduino IDE: 5 Kauj Ruam
Video: Neopixel WS2812 Ring Clock 2024, Hlis ntuj nqeg
Anonim
Image
Image

Nyob zoo cov neeg hauv phau ntawv qhia no peb yuav kawm paub siv neopixel ws2812 LEDs lossis coj sawb lossis coj matrix lossis coj lub nplhaib nrog m5stack m5stick-C pawg thawj coj loj nrog Arduino IDE thiab peb yuav ua tus qauv zaj sawv nrog nws.

Kauj Ruam 1: Yam Koj Xav Tau

Yam Koj Xav Tau
Yam Koj Xav Tau
Yam Koj Xav Tau
Yam Koj Xav Tau
Yam Koj Xav Tau
Yam Koj Xav Tau

Rau cov lus qhia no peb xav tau cov khoom hauv qab no: m5stack m5stick-C development boardType C usb cableWs2812 neopixel coj sawb/coj matrix/coj lub nplhaib/ob peb leds

Kauj ruam 2: Nruab ESP32 Boards Un Your Arduino IDE

Nruab ESP32 Boards Un Koj Arduino IDE
Nruab ESP32 Boards Un Koj Arduino IDE

Nco ntsoov tias koj tau teeb tsa ESP32 cov laug cam hauv koj Arduino IDE thiab yog tias nws tsis yog li ntawd, thov ua raws li cov lus qhia hauv qab no kom ua li ntawd: ESP32 BOARDS INSTALL:

Kauj ruam 3: Circuit Court

Circuit Court
Circuit Court
Circuit Court
Circuit Court
Circuit Court
Circuit Court

Qhov tam sim no yog qhov yooj yim heev: Din tus pin ntawm Neopixel yuav mus rau tus pin G26 ntawm m5stick-C. Thiab Vcc/Vin ntawm neopixel yuav xav tau 5v thiaj li tau txais 5v los ntawm qee lub zog siv thiab Gnd tus pin ntawm neopixel yuav mus rau Gnd ntawm qhov ntawd 5v zog Thiab Gnd tus pin ntawm neopixel tseem yuav txuas nrog gnd tus pin ntawm m5stick-C los muab rau hauv av. Qhov lwm txoj kev kuj tseem muaj rau hauv Circuit (hais yog tias koj lub m5stick-C roj teeb raug tso tawm): Hauv qhov xwm txheej ntawd koj tuaj yeem txuas tau 5v fais fab mov 5v/Vcc tus pin rau Vcc/Vin tus pin ntawm neopixel & 5v tus pin ntawm m5stick-C zoo ib yam yuav mus rau G26 ntawm m5stick-C pawg thawj coj loj. Please thov xa cov duab txuas txuas rau koj qhov kev siv yog tias koj ntsib teeb meem. Thiab rau lub zog 5v DC rau hauv Circuit Court kuv siv Arduino's Vin pin & Gnd pin vim tias arduino tau txais lub zog los ntawm usb cable uas Nco tseg: yog tias koj siv arduino thiab txhawb nws nrog ntau dua 5V ua tsis siv Vin tus pin, siv Vin tus pin nkaus xwb yog tias arduino tau txais lub zog los ntawm qee qhov 5v qhov txwv tsis pub siv Vcc tus pin hloov Vin tus pin.

Kauj ruam 4: Uploading Code

Tso Cai
Tso Cai
Tso Cai
Tso Cai

Ua ntej rub tawm cov cai kom ntseeg tau tias koj tau teeb tsa lub tsev qiv ntawv FastLED hauv koj Arduino IDE yog tias tsis thov ua qhov no ua ntej. Please luam cov cai hauv qab no & xa nws mus rau koj lub m5stick-c pawg thawj coj loj siv Arduino IDE.: Ua ntej Tshaj Tawm cov cai nake paub tseeb tias koj tau nkag mus rau tus lej ntawm koj li neopixel muaj nyob hauv cov cai raws li kuv nkag mus rau 64 LEDs vim tias kuv muaj 64 coj hauv kuv neopixel matrix./* Thov nruab FastLED lub tsev qiv ntawv ua ntej. Hauv arduino tsev qiv ntawv tswj kev tshawb fawb FastLED */#suav nrog "M5Stack.h"#suav nrog "FastLED.h" #define Neopixel_PIN 26 // nkag tsis tau. ntawm LEDs koj neopixel muaj#txhais NUM_LEDS 64CRGB leds [NUM_LEDS]; uint8_t gHue = 0; TaskHandle_t FastLEDshowTaskHandle = 0; TaskHandle_t userTaskHandle = 0; tsis muaj teeb meem teeb tsa () {Serial.begin (115200); M5.begin (); M5. Lcd.clear (BLACK); M5. Lcd.setTextColor (YELLOW); M5. Lcd.setTextSize (2); M5. Lcd.setCursor (40, 0); M5. Lcd.println ("Piv txwv Neopixel"); M5. Lcd.setTextColor (WHITE); M5. Lcd.setCursor (0, 25); M5. Lcd.println ("Cov duab zaj sawv"); // Neopixel initialization FastLED.addLeds (leds, NUM_LEDS).setCorrection (TypicalLEDStrip); FastLED.setBrightness (10); xTaskCreatePinnedToCore (FastLEDshowTask, "FastLEDshowTask", 2048, NULL, 2, NULL, 1);} void loop () {} void FastLEDshowESP32 () {if (userTaskHandle == 0) {userTaskHandle = xTaskGetCurrent) xTaskNotifyGive (FastLEDshowTaskHandle); const TickType_t xMaxBlockTime = pdMS_TO_TICKS (200); ulTaskNotifyTake (pdTRUE, xMaxBlockTime); userTaskHandle = 0; }} void FastLEDshowTask (void *pvParameters) {rau (;;) {fill_rainbow (leds, NUM_LEDS, gHue, 7); // rainbow effect FastLED.show (); // yuav tsum tau ua rau neopixel ua tau zoo EVERY_N_MILLISECONDS (20) {gHue ++; }}}

Kauj Ruam 5: Zaj sawv ntawm Neopixel LED

Image
Image
Zaj sawv ntawm Neopixel LED
Zaj sawv ntawm Neopixel LED

Yog li tom qab xa cov cai, koj tuaj yeem pom tus qauv zaj sawv tau nthuav tawm ntawm kuv neopixel LED matrix thiab nws yuav tshwm rau koj neopixel coj sawb/matrix/ring. Please xa cov vis dis aus kom pom nws ua haujlwm.

Pom zoo: