Cov txheej txheem:
- Kauj Ruam 1: Cov Cheeb Tsam Xav Tau
- Kauj ruam 2: Circuit Schema
- Kauj ruam 3: Programming
- Kauj Ruam 4: Qhov tshwm sim
Video: Potentio Qhov Taw Qhia Siv RGB Neopixel: 4 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
Hauv kab lus no kuv yuav ua qhov ntsuas ntsuas ntawm lub ntsuas hluav taws xob siv RGB Nano pixel ntiv nplhaib.
Yog li, pes tsawg qhov kev tawm tsam ua rau ntawm lub hwj chim ntsuas hluav taws xob yuav tshwm rau ntawm lub nplhaib RGB
Kauj Ruam 1: Cov Cheeb Tsam Xav Tau
cov khoom xav tau los ua nws:
- Arduino Nano v.3
- RGB RIng NeoPixels
- Potentiometer
- Jumper Hlau
- USB mini tso
- Pawg Thawj Coj
Kauj ruam 2: Circuit Schema
Sib sau ua ke tag nrho cov khoom siv raws li cov phiaj xwm rho tawm saum toj no.
Arduino rau Potensio & RGB Ring
+5V ==> 3. Potensio & VCC
GND ==> 1. Potensio & GND
A0 ==> 2. Potensio
D12 ==> IN
Kauj ruam 3: Programming
Luam cov cai hauv qab no, thiab muab nws tso rau hauv koj daim duab
#include #ifdef _AVR_ #include // Yuav tsum tau rau 16 MHz Adafruit Trinket #endif
#Txhais tus lej PIN 12
#define NUMPIXELS 16
Adafruit_NeoPixel pixels (NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
#define DELAYVAL 10
void teeb tsa () {
#if txhais (_ AVR_ATtiny85_) && (F_CPU == 16000000)
clock_prescale_set (clock_div_1); #ib
pixels.begin ();
pixels.setBrightness (10);
Serial.begin (9600); }
void lub voj ()
{pixels.clear (); int val = analogRead (A0); val = daim ntawv qhia (val, 0, 1023, 0, 18);
yog (val == 1) {rau (int i = 0; i <1; i ++) {pixels.setPixelColor (i, pixels. Color (0, 225, 0)); ncua (10); }}
yog (val == 2)
{rau (int i = 0; i <2; i ++) {pixels.setPixelColor (i, pixels. Color (32, 225, 0)); ncua (10); }}
yog (val == 3)
{rau (int i = 0; i <3; i ++) {pixels.setPixelColor (i, pixels. Color (64, 225, 0)); ncua (10); }}
yog (val == 4)
{rau (int i = 0; i <4; i ++) {pixels.setPixelColor (i, pixels. Color (96, 225, 0)); ncua (10); }}
yog (val == 5)
{rau (int i = 0; i <5; i ++) {pixels.setPixelColor (i, pixels. Color (128, 225, 0)); ncua (10); }}
yog (val == 6)
{rau (int i = 0; i <6; i ++) {pixels.setPixelColor (i, pixels. Color (160, 225, 0)); ncua (10); }}
yog (val == 7)
{rau (int i = 0; i <7; i ++) {pixels.setPixelColor (i, pixels. Color (192, 225, 0)); ncua (10); }}
yog (val == 8)
{rau (int i = 0; i <8; i ++) {pixels.setPixelColor (i, pixels. Color (225, 225, 0)); ncua (10); }}
yog (val == 9)
{rau (int i = 0; i <9; i ++) {pixels.setPixelColor (i, pixels. Color (225, 225, 0)); ncua (10); }}
yog (val == 10)
{rau (int i = 0; i <10; i ++) {pixels.setPixelColor (i, pixels. Color (225, 192, 0)); ncua (10); }}
yog (val == 11)
{rau (int i = 0; i <11; i ++) {pixels.setPixelColor (i, pixels. Color (225, 160, 0)); ncua (10); }}
yog (val == 12)
{rau (int i = 0; i <12; i ++) {pixels.setPixelColor (i, pixels. Color (225, 128, 0)); ncua (10); }}
yog (val == 13)
{rau (int i = 0; i <13; i ++) {pixels.setPixelColor (i, pixels. Color (225, 96, 0)); ncua (10); }}
yog (val == 14)
{rau (int i = 0; i <14; i ++) {pixels.setPixelColor (i, pixels. Color (225, 64, 0)); ncua (10); }}
yog (val == 15)
{rau (int i = 0; i <15; i ++) {pixels.setPixelColor (i, pixels. Color (225, 32, 0)); ncua (10); }}
yog (val == 16)
{rau (int i = 0; i <16; i ++) {pixels.setPixelColor (i, pixels. Color (225, 0, 0))); ncua (10); }}
yog (val == 17)
{rau (int i = 0; i <17; i ++) {pixels.setPixelColor (i, pixels. Color (225, 0, 0))); ncua (10); }}
yog (val == 18)
{rau (int i = 0; i <18; i ++) {pixels.setPixelColor (i, pixels. Color (225, 0, 0))); ncua (10); }} pixels.show (); ncua (DELAYVAL); }
Sketch file tuaj yeem rub tawm hauv qab no:
Kauj Ruam 4: Qhov tshwm sim
Txog cov txiaj ntsig tuaj yeem pom hauv video saum toj no.
Yog li txhua lub sijhawm ntsuas lub zog tig, tus lej thiab xim ntawm LEDs ntawm lub nplhaib yuav ci raws li tus lej ntawm qhov ua tiav ntawm lub hwj chim.
Pom zoo:
LED Qhov Taw Qhia Qhov Taw Qhia Tus Menyuam: 5 Kauj Ruam (nrog Duab)
LED Qhov Taw Qhia Qhov Taw Qhia Tus dev: Kuv ib txwm coj kuv tus dev Rusio mus taug kev thaum lub hnub poob qis kom nws tuaj yeem ua si yam tsis tau kub heev. Qhov teeb meem yog tias thaum nws tawm ntawm txoj hlua qee zaum nws tau zoo siab heev thiab ua haujlwm ntau dua li nws yuav tsum thiab nrog lub teeb qis thiab lwm tus dev
Lub Hom Phiaj Taw Qhia: Tsim Lub Hom Phiaj Kawm/Qhia Txoj Kev/Cov Txheej Txheem Siv Cov Duab Puncher: 5 Kauj Ruam
Lub Hom Phiaj Taw Qhia: Tsim Lub Hom Phiaj Kawm/Qhia Txoj Kev/Cov Qauv Siv Cov Duab Puncher: Kawm/qhia txoj hauv kev rau cov tub ntxhais kawm tshiab rau kev tsom mus rau lub hom phiaj. Nov yog txoj hauv kev tso cai rau lawv kom pom kev thiab pom cov txheej txheem ntawm kev tsim cov khoom los ntawm cov chav kawm. EkTools 2-nti loj punch; cov duab zoo tshaj plaws. 2. Daim ntawv los yog c
Hnub Ci Charger, GSM, MP3, Roj teeb Go-Pro, Nrog Roj Teeb Qhia Qhov Taw Qhia!: 4 Cov Kauj Ruam
Hnub Ci Charger, GSM, MP3, Roj teeb Go-Pro, Nrog Lub Roj Teeb Qhia Qhov Taw Qhia!: Ntawm no txhua yam pom nyob hauv cov thoob khib nyiab.-1 usb txhawb DC 0.9v/5v (lossis tshem tawm USB Tsheb Cigarette Charger Teeb 5v,+ thaum kawg thiab-ntawm ib sab ntawm lub ntsiab lus) -1 Cov roj teeb (cov menyuam yaus ua si) -1 lub hnub ci vaj huam sib luag (ntawm no 12 V) tab sis 5v yog qhov zoo tshaj plaws! -1 GO-Pro Ba
Yuav Ua Li Cas Thiaj Li Taw Qhia Qhov Taw Qhia: 6 Kauj Ruam
Yuav Ua Li Cas Thiaj Li Qhia Tus Kheej: Lub hom phiaj tseem ceeb ntawm daim ntawv thov no yog txhawm rau ntsuas qhov hnyav ntawm ib yam khoom tom qab ntawd qhia nrog lub tswb nrov thaum muaj qhov hnyav dhau. Cov tswv yim ntawm lub kaw lus los ntawm lub xov tooj ntawm tes. Kev tawm tswv yim yog lub teeb liab sib piv uas tau nthuav dav los ntawm qhov sib txawv
Arduino: Qhov Taw Qhia Muaj Peev Xwm Siv Led Matrix MAX7219: 4 Cov Kauj Ruam
Arduino: Qhov Ntsuas Pom Zoo Siv Led Matrix MAX7219: Hauv qhov kev qhia yav dhau los Kuv tau ua lub zog ntsuas qhov ntsuas siv lub nplhaib RGB neo pixels coj. koj tuaj yeem pom nws hauv kab lus no " Potentio Qhov Ntsuas Siv RGB Neopixel " Thiab hnub no kuv yuav qhia lub hwj chim ntsuas ntsuas siv MAX7219 coj mus ntsib