Cov txheej txheem:

LED Tswmciab rau Ntawv Lanterns: 3 Kauj Ruam
LED Tswmciab rau Ntawv Lanterns: 3 Kauj Ruam

Video: LED Tswmciab rau Ntawv Lanterns: 3 Kauj Ruam

Video: LED Tswmciab rau Ntawv Lanterns: 3 Kauj Ruam
Video: Cas yim laus es pheej yim nco.9/4/2018 2024, Hlis ntuj nqeg
Anonim
LED Tswmciab rau Ntawv Teeb
LED Tswmciab rau Ntawv Teeb

Txoj haujlwm no qhia pom yuav ua li cas thiaj pom lub tswm ciab zoo rau kev siv piv txwv hauv Ntawv Lanterns. Nws siv NodeMCU board (ESP8266) los tsav NeoPixels, tseem hu ua WS2812 LEDs. Saib cov vis dis aus hauv ntu kev ntsuas kom pom kev sib piv nrog cov tswm ciab tiag.

Kauj ruam 1: Kho vajtse

Kho vajtse
Kho vajtse
Kho vajtse
Kho vajtse
Kho vajtse
Kho vajtse
Kho vajtse
Kho vajtse

WS2812 LEDs, yog cov xim puv xim uas tau txuas nrog hauv cov lej, yog tus kheej tuaj yeem hais tau, thiab tuaj yeem muaj lawv cov xim liab, ntsuab thiab xiav teeb tsa nruab nrab ntawm 0 thiab 255.

Los ntawm txoj haujlwm yav dhau los Kuv muaj qee cov kab laug sab laug, raws li muaj qee qhov sib nrug ntawm LEDs, Kuv xaiv siv 4 LEDs hauv tus ntoo khaub lig rau ib lub teeb.

Raws li nrog txhua qhov haujlwm WS2812 nws tau pom zoo kom ntxiv qhov tiv thaiv me me ntawm thawj cov ntaub ntawv channel (nruab nrab xaim). Thiab ntxiv rau, ntxiv lub capacitor ze rau lub zog xa khoom. Lub hwj chim Amp nyob ntawm tus naj npawb ntawm LEDs.

Kauj ruam 2: Software

Software
Software

Hauv qhov haujlwm no LEDs tsis tau tsav los ntawm Arduino, tab sis yog NodeMCU board (ESP8266) nrog MicroPython ntawm nws.

Thawj kauj ruam yog sab saum toj nyem micropython firmware raws li phau ntawv qhia no: Pib nrog MicroPython ntawm ESP8266

Nws yog qhov ua tau siv nws los tsav cov LEDs zoo li qhia hauv 11. Tswj NeoPixels

Ntawm kuv lub Rooj Tswjhwm Saib Machine.pin (4) yog D2 (raws li pom hauv daim duab). Tsis txhob hnov qab txuas lub gnd nrog LEDs.

Txhawm rau ua kom lub ntsej muag coj zoo li lub tswm ciab tiag tiag kuv tau sau qhov kev pab cuam nab nab me me uas tau hloov kho tus kheej leds tom qab kev faib tawm gaussian pom hauv cov lus ntawm kab lus no:

Qhov kev zov me nyuam (main.py) tsim ntau yam khoom LED_light raws li tau teev tseg hauv LED_COUNT tas li.

Los ntawm kev hloov pauv tsis sib xws, qhov ntev thiab qhov siv ntawm lub teeb, nws tsim cov txiaj ntsig zoo.

Qhov tshwm sim Random LED Brightness 50% 77% - 80% (nws tsis tshua pom pom) 30% 80% - 100% (pom tau zoo heev, sim cua flicker) 5% 50% - 80% (pom tau zoo heev, tshuab nplaim taws) 5% 40% - 50% (pom tau zoo heev, nplaim taws tawm) 10% 30% - 40% (pom tau zoo heev, nplaim taws nplaim taws) txhua qhov no nrog lub sijhawm Gaussian qhov tseeb. Qhov tshwm sim Random Sijhawm 90% 20 ms 3% 20 - 30 ms 3% 10 - 20 ms 4% 0 - 10 ms

qhov chaw: Eric cov lus pom ntawm

Kauj Ruam 3: Qhov tshwm sim

Qhov txiaj ntsig muab cov txiaj ntsig zoo ib yam li muaj cua los ua lub tswm ciab flicker.

Hauv qhov yeeb yaj kiab thib ob lub teeb nyob tom qab yog LED raws thiab ib zaug nyob rau pem hauv ntej yog cov tswm ciab tiag rau kev sib piv.

Pom zoo: