Cov txheej txheem:

LED Moos Siv Neopixels: 4 Kauj Ruam (nrog Duab)
LED Moos Siv Neopixels: 4 Kauj Ruam (nrog Duab)

Video: LED Moos Siv Neopixels: 4 Kauj Ruam (nrog Duab)

Video: LED Moos Siv Neopixels: 4 Kauj Ruam (nrog Duab)
Video: Цепи (feat. 104) 2024, Kaum ib hlis
Anonim
LED Moos Siv Neopixels
LED Moos Siv Neopixels
LED Moos Siv Neopixels
LED Moos Siv Neopixels
LED Moos Siv Neopixels
LED Moos Siv Neopixels
LED Moos Siv Neopixels
LED Moos Siv Neopixels

Txais tos rau kuv cov lus qhia yuav ua li cas thiaj ua lub moos LED siv 60 Neopixels.

Koj yuav pom 3 PDF txuas ib qho yog rau ntu ntu ntawm lub moos, lwm qhov yog rau lub hauv paus thiab kawg ib qho yog tus qauv los pab nrog gluing cov ntu ua ke.

Yog li txhawm rau ua tiav qhov no koj yuav xav tau cov hauv qab no

  • Ntiv nplhaib ntawm 60 neopixels los hauv 4 lub hlis twg. nrhiav "ws2812 nplhaib 60" (£ 12.00)
  • RTC tshawb rau "DS3231 module" (£ 2.50)
  • Arduino Nano (£ 4)
  • 3 hli/1/8 "plywood.
  • tej xaim. vam tias koj yuav muaj qee yam nyob ib puag ncig?
  • 5v USB fais fab mov chav tsev. Hom koj cov menyuam yuav tau rhuav tshem qhov txuas rau.

Hauv qab no yog Lipo cov khoom siv roj teeb tab sis tom qab ntsuas, lub moos tau siv lub zog ntau dhau yog li lub roj teeb tau nqis los ntawm qhov tseem ceeb ntawm USB PSU.

  • dc-dc converter tshawb nrhiav "txhawb kev hloov pauv" (£ 3)
  • Them nqi hluav taws xob TP4056 tshawb "tp4056" (£ 2)
  • LiPo 1000Mah ib lub xov tooj. tshawb rau "1000mah lipo 3.7" LOS YOG "503450 lipo" (£ 8.00)

Tus lej LiPo yog 503450 thiab nws yuav zoo paub tias qhov no txhais tau tias 50mm ntev 34mm dav thiab 5.0 tob.

Kauj Ruam 1: Ntoo Ntoo

Ntoo Ntoo
Ntoo Ntoo
Ntoo Ntoo
Ntoo Ntoo
Ntoo Ntoo
Ntoo Ntoo

Koj yuav tsum muaj peev xwm pom hauv cov duab uas kuv tau luam tawm tus qauv thiab kaw nws ib yam li cov plywood. Dab tsi yuav tsis pom tseeb yog kuv tau txiav tawm 3 ntu ib zaug thiab ntu hauv qab tau txiav tawm ua ntej ib puag ncig, tom qab ntawd ib ntu raug tshem tawm (los ntawm nraub qaum) tom qab ntawd lub qhov raug txiav tawm hauv ob seem uas seem tom qab ntawd lwm ntu tshem tawm tsuas yog lub hauv ntej me ntsis seem tom qab ntawd lub qhov rau cov xov hlau tau txiav.

Thaum tag nrho cov khoom tau raug txiav tawm koj yuav tsum xub xyuas seb lawv txhua tus haum ua ke tom qab ntawd muab lawv txhuam. Kuv tau tsim 3 txheej nyob rau sab saum toj ntawm lub phiaj xwm ntawm lub moos kom ntseeg tau tias txhua yam tau ua tiav. Kuj xyuas kom ntseeg tau tias koj tau txais cov khoom hauv qab hauv qhov kev qhia raug thiab qhov nruab nrab daim hlais tau teeb tsa upside down yog li koj hla hla cov pob qij txha.

Cov qhov nyob rau ntu ntu hauv ntej tso cai rau cov pob qij txha txuas rau hauv cov rooj zaum zaum hauv. Thiab ntu qis tso cai rau cov xov hlau hla mus.

Cov duab hauv kab ntawv tseem qhia tau tias lub hauv paus tau muab tso ua ke li cas.

Kauj Ruam 2: Txuas lub Nplhaib LED

Txuas lub nplhaib LED
Txuas lub nplhaib LED
Txuas lub nplhaib LED
Txuas lub nplhaib LED
Txuas lub nplhaib LED
Txuas lub nplhaib LED
Txuas lub nplhaib LED
Txuas lub nplhaib LED

Tsis yog ntau los hais txog cov kauj ruam no, tab sis tsuas yog thaum koj tsis tau siv lub strip ntawm WS2812LED's lawv tau ntse yog li txhua tus muaj cov ntaub ntawv hauv thiab tawm. Hauv arcs ntawm 15 LED's PCB saib xyuas txhua qhov kev sib txuas tab sis thaum koj los koom nrog cov ntu koj yuav tsum ua lub zog sib txuas thiab cov ntaub ntawv. Koj tsis tuaj yeem tau txais kev sib txuas tsis raug vim tias lawv nyob hauv lub voj voog txawm li cas los xij thaum koj ua tiav lub voj voog koj yuav tsum muaj ib qhov txuas uas ploj lawm ntawm cov ntaub ntawv IN/OUT tso cai rau koj txuas cov xov hlau mus rau cov ntaub ntawv IN. Qhov twg cov xov hlau txuas rau cov ntaub ntawv IN yuav yog thawj LED lossis raws li nws tau suav tus lej xoom.

Kuv xav paub tias txoj hauv kev zoo tshaj plaws los kho lub nplhaib ntawm LED li cas rau lub nplhaib ntoo? tab sis thaum kawg kuv txiav txim siab siv looming qaum thiab ntos ib ncig ncig hla ib qho LED txhua lub sijhawm.

Kauj Ruam 3: Txuas Arduino Nano thiab Fais Fab

Txuas lub Arduino Nano thiab Lub Hwj Chim
Txuas lub Arduino Nano thiab Lub Hwj Chim
Txuas lub Arduino Nano thiab Lub Hwj Chim
Txuas lub Arduino Nano thiab Lub Hwj Chim
Txuas lub Arduino Nano thiab Lub Hwj Chim
Txuas lub Arduino Nano thiab Lub Hwj Chim

Kuv xub txiav txim siab siv LiPo ntawm txoj haujlwm no tab sis thaum kuv sim nws tawm lub roj teeb uas ntsaws ib hmo. Thaum xub thawj kuv xav tias lub roj teeb yuav tau duff yog li kuv tau ntsuas tam sim no thiab pom tias lub Circuit Court tau teeb duab 73mA uas txhais tau tias ntawm lub roj teeb nws yuav mus ntau dua. Qhov tseeb kuv ntsuas tam sim no ntawm lub roj teeb (ua ntej lub zog hloov pauv) thiab tshawb pom nws dhau 110mA. Yog li nws tau pom tseeb tias lub moos no yuav tsis siv roj teeb.

Yog li hloov kuv xaiv siv 5V USB them nyiaj. Kuv zoo li muaj cov neeg tuag USB them nyob ib puag ncig vim qhov txuas tau txais kev tsim txom los ntawm ob tus menyuam yaus.

Yog li vim tias peb siv WS2812 LED's peb tsuas muaj 3 qhov txuas rau Arduino Nano.

  • Fais fab
  • Hauv av
  • Cov ntaub ntawv IN. Txiv kab ntxwv rau D2 ntawm Nano

Tom ntej no peb muaj RTC qhov no tsuas muaj 4 xov hlau.

  • Hwj chim 5 Volts
  • Hauv av
  • SCL (I2C Moos) Xiav rau A5 ntawm Nano
  • SDA (I2C Cov Ntaub Ntawv) Daj rau A4 ntawm Nano

Thaum kawg peb xav tau lub zog thiab qhov no mus rau lub zog 5 V lub dav hlau ntawm Nano.. lub Vin tau tsim los kom muaj qhov hluav taws xob loj dua 5 volts (piv txwv li 7-12 Volts) thiab hauv av.

Kauj Ruam 4: Txoj Haujlwm

Kuv yeej txaus siab rau lub cajmeem, Kuv tsuas yog tsis zoo rau nws.

Teeb meem 1

Cov vib nas this thiab feeb tau raug nthuav qhia raws tus lej los ntawm 0-59. Txawm li cas los xij thawj LED thiab yog li qhov xoom yog nyob hauv qab. Yog li qhov no xav tau los kho.

tsis muaj tseeb correctPos (int A)

{yog (A 30) {A = A - 31; } temp = UA; }

Teeb meem 2

Kuv tau sim tshem tag nrho cov LED ua ntej tso tawm txoj haujlwm tshiab txawm li cas los qhov no ua rau LED lub ntsais. Yog li kuv tau txiav txim siab teeb tsa LED tom ntej thiab tom qab ntawd tua qhov dhau los. Qhov no ua haujlwm zoo xwb ?? NOPE vim tias yog txoj haujlwm tshiab yog xoom nws yuav sim thiab tua -1. yog li ntawd tau daws nrog tib lub sijhawm.

void deletePrevious (int B)

// rho tawm cov coj yav dhau los, yog tias nws yog xoom ces // tua 59 lwm tus tsuas yog rho tawm 1 // thiab tig qhov ntawd tawm. {yog (B == 0) {strip.setPixelColor (59, 0, 0, 0); // Tag nrho tawm} lwm yam {strip.setPixelColor (B - 1, 0, 0, 0); // tag nrho tawm}}

Teeb meem 3

Ua qhov saum toj no ua haujlwm tau zoo tiag tiag kom txog thaum txoj haujlwm thib ob tshiab nyob hauv qhov qub feeb. Uas txhais tau tias feeb uas tau hloov kho tom qab lub vib nas this muab nws tua! Ib yam rau teev/feeb ib yam nkaus

yog (secs == feeb-1)

{strip.setPixelColor (feeb-1, 0, 30, 0); }

Teeb meem 4

Tej yam tau pib zoo zoo yog li cia peb sib xyaw cov xim thaum lawv poob rau tib txoj haujlwm?

yog (min == secs)

{strip.setPixelColor (feeb, 15, 13, 0); // ntsuab thiab liab kom daj. }

Teeb meem 5

Cov xuab moos pib ua hom ntawv 24 teev. yog li qhov no xav tau kev kho ua ntej

yog tias (teev> 12)

{teev = teev -12; }

Teeb meem 6

Thiab tsis txhob hnov qab muaj 24 teev nyob rau ib hnub thiab kuv muaj 60 LED's. Yooj yim tiag tiag nws los ntawm 5

teev = teev * 5;

Teeb meem 7

Ua tiav qhov saum toj no peb tam sim no muaj teev dhia 4 LED nws yuav zoo dua yog tias nws siv tag nrho cov LED thiab ua kom pom pom ib feem ntawm ib teev? Dua qhov no yog qhov kho tau yooj yim kuv nyuam qhuav ntxiv thawj feeb tus lej faib ua 12 rau cov teev.

teev = teev + (addMin/12);

Teeb meem 8

Thaum teev lossis feeb coj yog hauv qab cov vib nas this ploj mus rau ib pliag ua ntej.

teev = yog (feeb == 0)

{yog (secs == 59) {strip.setPixelColor (59, 0, 30, 0); // ntsuab}} yog (teev == 0) {yog (secs == 59) {strip.setPixelColor (59, 0, 30, 0); // ntsuab}}

Teeb meem 9

Teeb lub sijhawm. Kuv txiav txim siab khaws qhov kev tsim no yooj yim heev yog li tsis suav nrog khawm los kho lub sijhawm. Yog li nws tsuas yog teeb meem ntawm kev txuas lub moos rau koj lub khoos phis tawj thiab thauj lub sijhawm tshiab. Ib qho tsis txaus siab rau nqe lus hauv qab no thiab teeb tsa koj lub sijhawm xav tau ces ntsaws qhov program. Thaum raug kho dua cov kab lus rov qab thiab rov kho qhov program, lwm qhov yog tias koj poob lub zog nws yuav rov teeb tsa thiab thauj lub sijhawm qub dua.

// Plaub Hlis 12, 2020 ntawm 11:20 teev tsaus ntuj koj yuav hu rau:

//rtc.adjust(DateTime(2020, 4, 12, 23, 20, 0));

Pom zoo: