Cov txheej txheem:

LED Huab Siv Fadecandy, PI thiab LED Sawb: 4 Kauj Ruam (nrog Duab)
LED Huab Siv Fadecandy, PI thiab LED Sawb: 4 Kauj Ruam (nrog Duab)

Video: LED Huab Siv Fadecandy, PI thiab LED Sawb: 4 Kauj Ruam (nrog Duab)

Video: LED Huab Siv Fadecandy, PI thiab LED Sawb: 4 Kauj Ruam (nrog Duab)
Video: Tswv Yexus lub neej thaum pib txug thaum xaus 2024, Kaum ib hlis
Anonim
LED Huab Siv Fadecandy, PI thiab LED Sawb
LED Huab Siv Fadecandy, PI thiab LED Sawb
LED Huab Siv Fadecandy, PI thiab LED Sawb
LED Huab Siv Fadecandy, PI thiab LED Sawb
LED Huab Siv Fadecandy, PI thiab LED Sawb
LED Huab Siv Fadecandy, PI thiab LED Sawb

Kuv tau ua qee qhov LED huab los tsim qhov chaw ib puag ncig hauv kuv lub tsev. Cov no tau pib siv rau lub koob tsheej uas tau raug hu tawm vim tias muaj kev kis thoob qhov txhia chaw.

Kuv tau siv cov khoom qab zib uas ploj lawm kom ua tiav cov duab zoo nkauj thiab kuv kuj tau siv Raspberry Pi yog li kuv tsis tas yuav muaj kuv lub khoos phis tawj tseem ceeb ntsaws rau. Rau cov uas tsis muaj raspberry pi qhov teeb tsa no yuav tsum yooj yim txaus ua nrog txhua lub khoos phis tawj tab sis nws yuav tsis tuaj yeem ua tus kheej. Saib cov schematic rau tus txheej txheem cej luam ntawm qhov no ua haujlwm li cas. Tus Pi teeb tsa tuaj yeem tswj hwm LEDs, nrog lwm lub khoos phis tawj wireless xa cov lus ntawm qhov yuav tso tawm, tawm hauv lub tshuab muaj zog dua los ua cov duab nrawm dua yog tias xav tau.

Qhov no yuav zoo li teeb tsa nyuaj rau nws yog dab tsi tab sis qhov no txhais tau tias lub teeb tau kho tau zoo heev thiab sib tham sib. Kuv tau siv lawv ua ke nrog Kinect ua qhov chaw nkag, teb rau lub suab, teb rau nas txav thiab lwm yam.

Kuv tau siv kev ua rau cov tsiaj ntawv zoo li nws yog cov lus yooj yim (yooj yim dua) siv, nrog ntau cov peev txheej thiab zej zog zoo. Fadecandy tuaj yeem tswj tau txog 8 daim kab xev ntawm 64 LEDS txawm li cas los xij, txoj haujlwm no tau yooj yim ua kom suav nrog ntau daim kab xev thiab Fadecandy cov laug cam.

Phau ntawv qhia no tau txais txiaj ntsig zoo los ntawm ntau lwm qhov chaw hauv is taws nem thiab nws tsuas yog txoj cai kuv muab rau lawv.

Amy Goodchilds qhia txog yuav teeb li cas LEDs nyob nrog Fadecandy

Phillip Burgess-1, 500 NeoPixel LED Kab Hlau nrog Raspberry Pi thiab Fadecandy

Daniel Shiffman's Coding tsheb ciav hlau qhia txog kev ua haujlwm

www.youtube.com/user/shiffman/playlists?vi…

Adafruit's Neopixel Überguide (tshwj xeeb yog ntu kev coj ua zoo tshaj plaws)

Khoom siv

Qhov

Fadecandy + USB cable-https://www.amazon.co.uk/Adafruit-FadeCandy-Dithe… lossis

WS2812B Addressable LED strips

A (1000 µF, 6.3V lossis siab dua) Capacitor

28awg Hlau

Raspberry Pi

5V Cov khoom siv hluav taws xob (Ampage yog nyob ntawm koj ntxiv rau qhov no tom qab)

Kuv siv

Txawm li cas los xij, Kuv tab tom txiav txim siab muab lub zog loj dua yog tias kuv nce qib. Xav paub ntau ntxiv tuaj yeem pom ntawm cov lus qhia txuas hauv qab no.

Ob qho no ua tej yam me ntsis yooj yim dua li siv txhua lub xaim

JST Connectors, Wago txuas (qhov no tsuas yog me ntsis yooj yim dua li siv tag nrho cov xov hlau)

Dupont Hlau 40pin Txiv neej rau Poj Niam

PCB header txuas

Daim kab xev, heatshrink

Khoom siv

Duab los qhia

Chickenwire

Polyester Hollowfibre (Fluff)

(Huv…) Thawv Thauj Mus Los

Cov cuab yeej

Cov hlua hluav taws xob, Cov Hluav Taws Xob Hluav Taws Xob, Txiab, Multimeter (Pab tau tab sis tsis tseem ceeb)

Kauj Ruam 1: Kev Tsim Huab

Kev Tsim Huab
Kev Tsim Huab
Kev Tsim Huab
Kev Tsim Huab
Kev Tsim Huab
Kev Tsim Huab
Kev Tsim Huab
Kev Tsim Huab

Kauj ruam 1

Thawj kauj ruam hauv kev tsim huab yog txhawm rau txhawm rau txuas JST txuas mus rau cov kab hluav taws xob LED. Ceev faj kom ua tau raws li kev coj ua thiab kev qhia ntawm cov txuas no.

Yog tias koj xav hla hla kev siv JST cov txuas, cov xov hlau tuaj yeem muab ncaj qha rau ntawm kab ntawv tab sis ua tib zoo saib xyuas cov xim thiab cim npe. Kuv siv 32 LED sawb thiab txuas JST txuas rau ob qho kawg. Qhov no yuav tso cai rau ob lub huab sib txawv los koom ua ib qho 64 LED ntev sawb thaum tso cai rau huab nws tus kheej kom hloov pauv thiab tswj tau.

Kauj ruam 2

Qhov no yog txhawm rau tsim cov duab los qhia (lossis lwm yam khoom siv) pob txha ntawm huab. Kuv siv cov duab los qhia raws li kuv muaj qee qhov dag puag ncig. Kuv tsim cov duab plaub ntev raws li pom los ntawm ob peb lub thawv loj. Txhawm rau ua cov ridgid no kuv tau siv qee tus qaib los tsim kev txhawb nqa qhov twg lub thawv khoov ntxiv nrog rau tsim kev koom nrog ntawm qhov kawg ntawm 'huab'.

Kauj ruam 3

Kuv txuas Cov LED strips rau huab. Kuv siv 4 kab ntawm 32 LEDs ib huab. Lawv muaj daim nplaum thim rov qab txawm li cas los xij, Kuv tau siv qee qhov ntawm cov hlau tsis muaj hlau txuas los muab lawv tso rau qhov chaw ntau dua ntawm qhov chaw.

Kauj ruam 4

Tam sim no peb tuaj yeem npog huab hauv nqaij qaib hlau. Qhov no yuav yog ib txwm tau dov tawm thiab yooj yim dua li nws zoo li tso rau ntawm lub raj. Nws yog qhov yooj yim dua nrog ob txhais tes ntxiv pab. Nws tuaj yeem khoov puag ncig thiab yuav tuav hauv qhov chaw. Kuv kuj tau txuas ob daim xaim xaim txhawm rau tsim cov dai dai. Kuv loops JST txuas ib ncig ntawm qee cov nqaij qaib hlau txhawm rau txhawm rau txo qis kev nruj ntawm cov laug txuas.

Kauj ruam 5

Kuv ntxiv Hollowfibre fluff rau cov qaib. Qee qhov haujlwm zoo sib xws siv cov kua nplaum kub tab sis nyob ntawm koj cov fiber qhov no yuav tsis tsim nyog. Ib daim loj yuav khaws cia nyob nruab nrab ntawm cov nqaij qaib thiab daim ntawv qhia zaub mov thiab sau qhov khoob yog qhov yooj yim.

Nrog koj zoo siab koj muaj huab. Kuv rov hais dua plaub zaug txog tam sim no kom muaj 4 huab. Qhov no tau tso cai rau kuv kom siv qhov Fadecandy boards muaj peev xwm tshaj plaws.

Kauj ruam 2: Fadecandy Teeb

Fadecandy Teeb
Fadecandy Teeb
Fadecandy Teeb
Fadecandy Teeb
Fadecandy Teeb
Fadecandy Teeb
Fadecandy Teeb
Fadecandy Teeb

Amy Goodchild cov lus qhia teeb tsa LEDs nrog Fadecandy mus rau hauv kev nthuav dav ntau dua li kuv yuav nyob ntawm no thiab meej heev.

Txhawm rau teeb tsa Fadecandy kuv xub xub muab ob lub taub hau tso rau ntawm lub nti.

Kuv tom qab ntawd siv qee tus Dupont txiv neej rau poj niam cov xov hlau coj mus rau qee qhov Wago txuas los txuas cov ntaub ntawv xov tooj mus rau qhov tseeb JST xaim. Cov ntaub ntawv xov tooj yuav tsum txuas nrog kab ntawm Fadecandy ze rau nruab nrab ntawm pawg thawj coj saib. Cov kab hauv qab yuav tsum tau txuas nrog lub zog tsis zoo tab sis ntau ntxiv rau qhov no tom qab.

Kauj ruam 3: Fais fab

Fais fab
Fais fab
Fais fab
Fais fab
Fais fab
Fais fab

Raws li kuv tsis npaj yuav siv ntau lub amps vim kuv tsis xav kom muaj ntau ntawm kuv cov LEDs nyob rau ib lub sijhawm rau cov huab no kuv tau xaiv los siv lub khoos phis tawj dav/5v PSU uas kuv muaj. Kuv tso lub capacitor hla lub davhlau ya nyob twg txhawm rau tiv thaiv cov hlua los ntawm qhov hluav taws xob loj loj ntawm kev qhib.

Saib xyuas kom faib lub zog siv cov xov hlau loj tsim nyog rau amps uas tau siv. Kuv faib qhov no tawm siv Wago txuas. Kev faib qhov no mus rau 8 khub ntawm qhov tsis zoo thiab zoo 5v xov hlau koj tuaj yeem koom nrog cov no rau JST cov txuas (lossis ncaj qha rau cov hlua LED).

Yog xav paub ntau ntxiv tham nrog Amy Goodchild qhov tsis yooj yim thiab Adafruit neopixel Überguide.

Thaum qhov no ua tiav koj tuaj yeem txuas cov ntaub ntawv pins rau JST muab txog 8 ua tiav JST kev sib txuas npaj kom txuas nrog koj cov huab (s).

Kuv 'Npaj' qhov kev tsis txaus ntseeg no mus rau hauv lub thawv nqa khoom thiab kaw nws kaw kom sim thiab ua kom nws zoo dua me ntsis.

Cov tswv yim yog usb mus rau Fadecandy, thiab cov xov hluav taws xob. Cov txiaj ntsig yog yim JST cable peb muab tso ua ke.

Yog tias koj xav sim Fadecandy board tau teeb tsa thiab khiav ua ntej pib nrog Pi koj tuaj yeem ntsaws nws rau hauv koj lub khoos phis tawj thiab rub tawm Fadecandy cov ntaub ntawv los ntawm https://github.com/scanlime/fadecandyKoj tuaj yeem ua cov ntaub ntawv cuam tshuam rau teeb tsa server thiab mus rau UI ntawm https:// localhost: 7890. los ntsuas lub teeb. Kuj tseem muaj cov qauv piv txwv ntawm kev ua yog tias koj xav kom muaj kev ua si ib puag ncig nrog lub teeb ntawm qhov no.

Kauj ruam 4: Raspberry Pi

Raspberry Pi
Raspberry Pi
Raspberry Pi
Raspberry Pi
Raspberry Pi
Raspberry Pi
Raspberry Pi
Raspberry Pi

Tam sim no peb paub Fadecandy tab tom tswj lub teeb, peb xav teeb tsa Pi los tswj nws yog li peb tuaj yeem ua ntau dua li tsuas yog tua lawv thiab qhib.

Phau ntawv qhia yuav teeb tsa Raspberry Pi nrog Fadecandy tuaj yeem pom ntawm no

learn.adafruit.com/1500-neopixel-led-curta…

Phau ntawv qhia no qhia ib qib zuj zus yuav teeb tsa Fadecandy server li cas nws pib los ntawm kev pib ua haujlwm ntawm kev pib lub raspberry pi. Nws tseem teeb tsa SSH yog li koj tuaj yeem nkag mus rau Pi hla lub network. Nws kuj tseem tsim nyog teeb tsa VNC kev tswj hwm rau PI cov duab vim qhov no yooj yim heev hauv Debian.

Thaum Pi tau teeb tsa koj muaj ntau txoj kev xaiv, koj tuaj yeem hloov chaw nyob ntawm Fadecandy server ntawm koj lub khoos phis tawj kom tswj lub teeb hla lub network.

Qhov no tuaj yeem ua tiav los ntawm kev hloov kab hauv kev ua piv txwv los ntawm

var socket = WebSocket tshiab ('ws: // localhost: 7890');

rau lub npe tseem ceeb Piv txwv var socket = WebSocket tshiab ('ws: //Pi.local: 7890');

Los yog

los ntawm kev hloov cov kab mus rau tus IP cuam tshuam

opc = tshiab OPC (qhov no, "192.168.0.x", 7890);

Koj tuaj yeem teeb tsa kev ua haujlwm ntawm Pi nws tus kheej kom khiav cov duab kos los ntawm kev txuas tus saib xyuas, nas thiab keyboard lossis hla VNC. Yog tias koj yog tus coder zoo dua li kuv kuv paub tseeb tias nws muaj peev xwm pib ua cov duab kos ntawm Pi pib los ntawm kev ua si puag ncig nrog

~/.config/lxsession/LXDE-pi/autostart

Sab hauv kev ua haujlwm koj yuav tsum tau hloov pauv daim duab qhia chaw ntawm koj lub pixels ntawm kev ua kom muaj kev cuam tshuam koj yuav ua li cas.

Ib qho piv txwv ua haujlwm yog tias peb qhib qhov ua piv txwv hu ua strip 64. Nyob ntawm seb muaj pes tsawg tus pixels koj tau ua hauv cov lus qhia no koj yuav xav hloov txoj cai kom haum. Muaj cov lus qhia dav dav ntawm Fadecandy git txog qhov no.

Mus rau kab hauv kab teeb tsa hais qhia.

// Qhia ib qho 64-LED kab txaij mus rau nruab nrab ntawm lub qhov rais

opc.ledStrip (0, 64, dav/2, qhov siab/2, dav/70.0, 0, cuav);

Nyob ntawm seb muaj pes tsawg LEDs hauv koj teeb tsa koj tuaj yeem hloov 64 rau tus lej ntawd. Piv txwv li yog tias koj tsuas yog ua ib qho huab ntawm 32 LEDs hloov qhov no mus rau 32.

Peb tuaj yeem tsim lub voj nyob rau hauv txhawm rau ua kom muaj cov lej ntawm cov kab ntawv ntawm txoj cai ntev. Hloov X thiab Y kom tsim nyog hauv kab hauv qab no thiab hloov kab peb tsuas yog tham hauv ntu teeb tsa.

// Daim ntawv qhia kab X X ntawm Y pixels txhua

rau (int i = 0; i <X; i ++) {

opc.ledStrip (i*64, Y, dav/2, I*Y + 30, 15, 0, cuav);

}

Nrog kev ua tiav qhov ua tau yog qhov kawg. Kuv yuav txuas ob peb cov vis dis aus ntawm kuv plaub huab ua yeeb yaj kiab dai ntawm kuv phab ntsa.

Ua tsaug rau koj siv sijhawm los nyeem qhov no. Raws li kuv tau hais thoob plaws kuv yuav tsis tuaj yeem ua qhov no yam tsis ua haujlwm hnyav ntawm lwm tus. Tshwj xeeb yog Amy Goodchild, Phillip Burgess, thiab Daniel Schiffman.

Kuv sim tsis rov ua qhov lawv tau hais hauv lawv tus kheej cov lus qhia tab sis yog tias koj los rau hauv ib qho teeb meem xa lus rau kuv thiab kuv yuav pom yog tias kuv tuaj yeem sim thiab pab.

Pom zoo: