Cov txheej txheem:
- Kauj Ruam 1: Yam Koj Xav Tau
- Kauj ruam 2: Kev sib txuas
- Kauj ruam 3: Code
- Kauj Ruam 4: Ua Kom Nws Pom
Video: Yuav Siv Neopixel Ws2812 LED lossis LED Sawb lossis Led Ring Nrog Arduino: 4 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
Nyob zoo cov menyuam txij li Neopixel coj Sawb tau nrov heev thiab nws tseem hu ua ws2812 coj sawb ib yam. Lawv yog cov neeg nyiam heev vim tias hauv cov kab no coj peb tuaj yeem hais qhia txhua tus thiab txhua tus coj sib cais uas txhais tau tias yog koj xav tau ob peb lub leds kom ci hauv ib qho xim, ob peb xim ntxiv & ob peb hauv qee qhov xim sib txawv ces nws tuaj yeem ua li ntawd. Txawm tias koj tuaj yeem ua rau txhua tus thiab txhua tus coj ci hauv xim twg koj xav tau tib lub sijhawm. Qhov no yog vim li cas lawv thiaj muaj koob meej.
Yog li hauv cov lus qhia no peb yuav kawm paub siv ws2812 lossis neopixel coj sawb nrog arduino li cas.
Kauj Ruam 1: Yam Koj Xav Tau
rau cov lus qhia no koj yuav xav tau cov hauv qab no:
Arduino
Adafruit NeoPixel strips
Kev tiv thaiv 10k ohm
Breadboard (generic)
Jumperwires (generic)
Kauj ruam 2: Kev sib txuas
Txog kev sib txuas thov ua raws daim duab uas pom thiab txuas txhua yam Raws li pom qhov sib txawv.
Kauj ruam 3: Code
Mus rub Adafruit lub tsev qiv ntawv NeoPixel:
github.com/adafruit/Adafruit_NeoPixel
kom pib Koj tuaj yeem rub tawm cov ntawv.zip nrog lub tsev qiv ntawv, unzip nws ntawm koj lub khoos phis tawj, thiab rub cov ntsiab lus rau hauv koj phau ntawv Arduino cov tsev qiv ntawv. (Cov "tsev qiv ntawv" feem ntau yog tsim nyob rau hauv tib qho "Arduino" nplaub tshev uas koj khaws koj cov duab kos. Yog tias koj tsis muaj ib qho, tseem mus tom ntej thiab tsim nws.) Tsis tas li, rov pib dua Arduino IDE yog tias koj twb tau qhib nws lawm.
Thaum nws rov tshwm sim dua, koj yuav muaj qee qhov piv txwv piv txwv tshiab. Cia wb mus saib!
Cov ntaub ntawv> Piv txwv> Adafruit NeoPixel> yooj yim
Tus txiv neej no yuav teeb koj cov LEDs ntsuab, ib zaug.
Lossis koj tuaj yeem theej cov cai hauv qab no & sim nws ib yam.
// NeoPixel Ring yooj yim kos duab (c) 2013 Shae Erisson // tso tawm raws li GPLv3 daim ntawv tso cai kom haum rau lwm qhov ntawm AdaFruit NeoPixel lub tsev qiv ntawv
#include "Adafruit_NeoPixel.h" #ifdef _AVR_ #include "avr/power.h" #endif
// Tus pin twg ntawm Arduino txuas nrog NeoPixels? // Ntawm Trinket lossis Gemma peb hais qhia hloov qhov no rau 1 #txhais tus lej 6
// Muaj pes tsawg NeoPixels txuas rau Arduino? #define NUMPIXELS 16
// Thaum peb teeb tsa NeoPixel lub tsev qiv ntawv, peb qhia nws pes tsawg tus pixels, thiab tus pin twg siv los xa cov cim. // Nco ntsoov tias rau cov kab ntawv qub NeoPixel koj yuav xav tau hloov qhov ntsuas thib peb-saib cov strandtest // piv txwv rau cov ntaub ntawv ntau ntxiv ntawm qhov muaj peev xwm ua tau. Adafruit_NeoPixel pixels = Adafruit_NeoPixel (NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
int ncua sij hawm = 500; // ncua rau ib nrab thib ob
void teeb () {// Qhov no yog rau Trinket 5V 16MHz, koj tuaj yeem tshem tawm peb kab no yog tias koj tsis siv Trinket #if tau hais tseg (_AVR_ATtiny85_) yog (F_CPU == 16000000) clock_prescale_set (clock_div_1); #endif // End of trinket code tshwj xeeb
pixels.begin (); // Qhov no pib ua lub tsev qiv ntawv NeoPixel. }
void voj () {
// Rau txheej txheej NeoPixels thawj NeoPixel yog 0, thib ob yog 1, txhua txoj kev mus txog rau suav cov pixels rho tawm ib qho.
rau (int i = 0; i
// pixels. Color siv RGB qhov tseem ceeb, los ntawm 0, 0, 0 txog 255, 255, 255 pixels.setPixelColor (i, pixels. Color (0, 150, 0)); // Nruab nrab qaim xim ntsuab.
pixels.show (); // Qhov no xa qhov hloov tshiab pixel xim rau kho vajtse.
ncua (ncua sij hawm); // Ncua sijhawm rau lub sijhawm (hauv milliseconds).
} }
Kauj Ruam 4: Ua Kom Nws Pom
Tom qab xa cov cai koj neopixel coj sawb yuav zoo ib yam li kuv thiab koj tseem tuaj yeem hloov pauv cov cai saum toj no kom pom nws txawv xim thiab koj tuaj yeem sim lwm qhov piv txwv los ntawm cov tsev qiv ntawv neopixel saum toj no thiab muaj kev lom zem nrog koj neopixel coj sawb.
Pom zoo:
DIY LED Sawb: Yuav Txiav Li Cas, Txuas, Cuam Tshuam thiab Hwjchim LED Sawb: 3 Kauj Ruam (nrog Duab)
DIY LED Sawb: Yuav Ua Li Cas Txiav, Txuas, Cuam Tshuam thiab Lub Hwj Huam LED Sawb: Pib qhia rau koj tus kheej lub teeb pom kev zoo siv LED sawb.Flexible ntseeg tau thiab siv tau yooj yim, LED strips yog qhov kev xaiv zoo tshaj plaws rau ntau yam kev thov.Kuv yuav npog cov hauv paus ntawm kev txhim kho yooj yim sab hauv tsev 60 LED's/m LED sawb, tab sis
Tswj Ws2812 Neopixel LED Sawb Hla Bluetooth Siv Arduino Uno: 4 Cov Kauj Ruam
Tswj Ws2812 Neopixel LED Sawb Hla Bluetooth Siv Arduino Uno: Nyob zoo cov neeg hauv phau ntawv qhia no peb yuav kawm paub tswj neopixel nrog arduino li cas. Yog li ntawd arduino yuav txuas nrog ntawm Bluetooth siv hc05 Bluetooth module rau lub xov tooj thiab smartphone yuav xa cov lus txib kom hloov xim ntawm neopixel coj sawb
ESP8266 RGB LED Sawb WIFI Tswj - NODEMCU Raws li IR Chaw Taws Teeb rau Led Sawb Tswj Hauv Wifi - RGB LED Sawb Smartphone Tswj: 4 Cov Kauj Ruam
ESP8266 RGB LED Sawb WIFI Tswj | NODEMCU Raws li IR Chaw Taws Teeb rau Led Sawb Tswj Hauv Wifi | RGB LED Sawb Smartphone Tswj: Nyob zoo cov neeg hauv qhov kev qhia no peb yuav kawm paub siv nodemcu lossis esp8266 li IR chaw taws teeb los tswj RGB LED sawb thiab Nodemcu yuav raug tswj los ntawm smartphone dhau wifi. Yog li hauv paus koj tuaj yeem tswj RGB LED Sawb nrog koj lub xov tooj
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: Nyob zoo cov neeg hauv cov lus qhia no peb yuav kawm paub siv neopixel ws2812 LEDs lossis coj sawb lossis coj matrix lossis coj lub nplhaib nrog m5stack m5stick-C txhim kho pawg thawj coj nrog Arduino IDE thiab peb yuav ua zaj sawv zaj sawv nrog nws
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: Hauv cov lus qhia no peb yuav kawm paub siv neopixel lossis ws 2812 lossis coj nrawm nrog Arduino.Qhov hom LED lossis kab txaij lossis lub nplhaib raug tswj los ntawm ib tus pin nkaus xwb thiab txhua qhov LEDs yog qhov chaw nyob tus kheej yog li cov no tseem hu ua indi