Cov txheej txheem:

LED Lub Plawv Duab Lub Cev - Ua Kom Zoo Tshaj Valentine lossis Hnub Yug Hnub Yug: 7 Kauj Ruam (nrog Duab)
LED Lub Plawv Duab Lub Cev - Ua Kom Zoo Tshaj Valentine lossis Hnub Yug Hnub Yug: 7 Kauj Ruam (nrog Duab)

Video: LED Lub Plawv Duab Lub Cev - Ua Kom Zoo Tshaj Valentine lossis Hnub Yug Hnub Yug: 7 Kauj Ruam (nrog Duab)

Video: LED Lub Plawv Duab Lub Cev - Ua Kom Zoo Tshaj Valentine lossis Hnub Yug Hnub Yug: 7 Kauj Ruam (nrog Duab)
Video: Tswv Yexus lub neej thaum pib txug thaum xaus 2024, Hlis ntuj nqeg
Anonim
LED Lub Plawv Duab Lub Cev - Ua kom zoo nkauj Valentine lossis Hnub Yug Tam Sim No
LED Lub Plawv Duab Lub Cev - Ua kom zoo nkauj Valentine lossis Hnub Yug Tam Sim No

Nyob zoo! Hauv cov lus qhia no kuv yuav qhia koj li cas koj tuaj yeem ua qhov txaus ntshai LED Lub Plawv Duab Duab Ncej. Rau txhua tus neeg nyiam Electronics! Ua kom zoo nkauj Valentine, Hnub Yug lossis Hnub Ua Ntej tam sim no rau koj cov neeg hlub!

Koj tuaj yeem saib Demo Video ntawm txoj haujlwm no ntawm cov vis dis aus hauv qab no thiab nyeem cov lus qhia ib kauj ruam zuj zus yuav ua li cas los tsim ib qho hauv cov ntawv hauv qab no. Tsis tas li yog tias koj xav tau koj tuaj yeem saib cov ncauj lus kom ntxaws DIY Video ntawm Txoj Haujlwm no ntawm kuv lub vev xaib raug cai, www. HowToMechatronics.com.

Kauj ruam 1: Demo Video

Image
Image

Yog li dab tsi peb muaj ntawm no yog daim duab yooj yim nrog 32 LEDs nyob rau hauv lub ntsej muag zoo li lub plawv nyob tom qab ntawm daim duab. Qhov no yog qhov ntxim nyiam DIY Cov Haujlwm thiab kuv pom zoo rau txhua tus neeg siv khoom siv hluav taws xob los tsim ib qho rau lawv tus hlub uas yog Hnub Valentine lossis Hnub Yug tam sim no.

Kauj Ruam 2: Cov Khoom Yuav Tsum Tau Ua

Arduino Nano - ntawm Banggood

Ultra Bright Liab LEDs - ntawm Banggood

Hloov - ntawm Banggood

Lub Hwj Chim Jack - ntawm Banggood

DC 5V> 1A Adapter - ntawm Banggood

2 x TLC5940 LED tsav tsheb

2 x 2K Resistors

1uF & 0.1uF Capacitors

Kauj Ruam 3: Npaj Daim Duab Ncej

Npaj Cov Duab Ncej
Npaj Cov Duab Ncej

Ua ntej koj xav tau daim duab thav duab yooj yim nrog qhov ntev hauv qab no: 18 x 13 cm. Ib qho ntxiv koj xav tau daim ntawv fiberboard txiav rau qhov loj ntawm tus ncej uas siv lub laum koj yuav ua rau 32 qhov kom koj tuaj yeem ntxig cov LEDs nyob ntawd.

Lub Anodes ntawm txhua lub LEDs yuav tsum tau muab muag ua ke thiab Cathodes yuav tsum txuas nrog TLC5940 PWM Tsav Tsheb. Tom qab siv cov laug koj yuav tsum tshuaj xyuas seb txhua lub LEDs ua haujlwm tau zoo.

Kauj ruam 4: Kev thaiv kab

Thaiv
Thaiv

Nov yog yuav ua li cas cov phiaj xwm hluav taws xob ntawm cov phiaj xwm no zoo li. Yog li siv Arduino Nano thiab TLC5940 ICs koj tuaj yeem tswj tau tag nrho 32 LEDs. Koj xav tau ob peb yam ntxiv, ob lub capacitors rau decoupling thiab ob tus tiv thaiv rau tam sim no txwv ntawm TLC5940. Koj tuaj yeem pom cov ntsiab lus ntxiv yuav ua li cas txuas thiab siv IC no nrog Arduino ntawm kuv qhov tshwj xeeb Arduino thiab TLC5940 Tutorial.

Kauj Ruam 5: Muab tag nrho ua ke

Muab tag nrho ua ke
Muab tag nrho ua ke

Tam sim no raws li kev qhia hauv Circuit koj yuav tsum txuas txhua yam ua ke. Ua ntej koj yuav tsum ntxig thiab muab txhuam tag nrho IC qhov ntsaws thiab tus pin taub hau nrog rau lub capacitors. Tom qab ntawd koj yuav tsum tau ntxig rau Arduino thiab LED Tsav Tsheb thiab txuas txhua yam ntxiv uas siv cov xov hlau dhia.

Thaum koj ua tiav nrog qhov no, koj yuav tsum rov tshuaj xyuas seb LEDs ua haujlwm tau zoo ua ntej txuas ntxiv mus. Koj tuaj yeem ua qhov ntawd los ntawm kev xa cov cai Arduino hauv qab no.

Kauj Ruam 6: Arduino Code

Txog Qhov Haujlwm no Kuv tau siv TLC5940 Lub Tsev Qiv Ntawv ua los ntawm Alex Leone. Koj yuav tsum tau ua qee qhov kev hloov kho thaum siv lub tsev qiv ntawv nrog ob lub TLC5940 ICs. Koj yuav tsum hloov kho cov ntaub ntawv tlc_config.h thiab hloov tus nqi ntawm qhov sib txawv NUM_TLCS rau tus nqi ntawm 2.

Nov yog qhov ua tiav Arduino code:

/ * LED Heart Photo Frame - Arduino Project * Program ua los ntawm Dejan Nedelkovski, * www. HowToMechatronics.com *

* TLC5940 Lub Tsev Qiv los ntawm Alex Leone, * Koj yuav tsum hloov kho tlc_config.h nyob hauv TLC5940 lub tsev qiv ntawv * thiab hloov tus nqi ntawm qhov sib txawv NUM_TLCS rau tus lej ntawm TLC5940 ICs txuas nrog */

#suav nrog "Tlc5940.h"

int theem = 0;

int randomNumber; int suav = 0; int qhov ci = 3500; int brightUp = 50; int dir = 1;

void teeb tsa () {

Tlc.init (); }

void voj () {

hloov (theem) {// ----- Theem 1 rooj plaub 0: randomNumber = (int) random (0, 31); Tlc.set (randomNumber, 4095); ncua (1500); Tlc.update (); yog (suav> = 8) {theem = 1; suav = 0; } lwm {++ suav; } tawg; // ----- Theem 2 rooj plaub 1: ncua (75); rau (int i = 31; i> = 0; i--) {Tlc.set (i, 4095); ncua (100); Tlc.update (); } ncua (500); Tlc.clear (); Tlc.update (); theem = 2; ncua (500); tawg; // ----- Theem 3 rooj plaub 2: rau (int i = 0; i 6) {theem = 3; suav = 0; } lwm {++ suav; } tawg; // ----- Theem 4 rooj plaub 3: rau (int i = 0; i = 0; i--) {Tlc.set (i, 0); Tlc.set (31-i, 0); Tlc.update (); ncua (70); } rau (int i = 15; i> = 0; i--) {Tlc.set (i, 4095); Tlc.set (31-i, 4095); Tlc.update (); ncua (70); } rau (int i = 0; i 1) {theem = 4; suav = 0; } lwm {++ suav; } tawg; // ----- Theem 5 rooj plaub 4: rau (int i = 15; i> = suav; i--) {Tlc.set (32-i, 4095); Tlc.update (); ncua (5); Tlc.set (32-i-1, 0); Tlc.update (); ncua (5); Tlc.set (kuv, 4095); Tlc.update (); ncua (5); Tlc.set (kuv+1,0); Tlc.update (); ncua (50); } yog (suav> 15) {Tlc.set (16, 4095); Tlc.update (); ncua (2000); theem = 5; suav = 0; } lwm {++ suav; } tawg; // ----- Theem 6 rooj plaub 5: rau (int i = 0; i = 3500) {brightUp = -50; ++ suav; } yog (ci ntsa iab 6) {theem = 6; suav = 0; ci ntsa iab = 3500; Tlc.clear (); Tlc.update (); } ncua (40); tawg; // ----- Theem 7 rooj plaub 6: rau (int i = 0; i <= 30; i+= 2) {Tlc.set (i, 4095); Tlc.set (kuv+1,0); } Tlc.update (); ncua (500); rau (int i = 0; i 20) {theem = 7; suav = 0; } lwm {++ suav; } tawg; // ----- Theem 8 rooj plaub 7: rau (int i = 31; i> = 16; i--) {Tlc.clear (); Tlc.update (); ncua (2); Tlc.set (kuv, 4095); Tlc.set (kuv+1, 2000); Tlc.set (kuv+2, 1000); Tlc.set (kuv+3,500); Tlc.set (kuv+4,300); Tlc.set (kuv+5,200); Tlc.set (kuv+6, 100); Tlc.set (kuv+7, 50); Tlc.set (kuv+8, 0);

Tlc.set (i-16, 4095);

Tlc.set (i-15, 2000); Tlc.set (i-14, 1000); Tlc.set (i-13, 500); Tlc.set (i-12, 300); Tlc.set (i-11, 200); Tlc.set (i-10, 100); Tlc.set (kuv+-9, 50); Tlc.set (i-8, 0); Tlc.update (); ncua (50); } yog (suav> 8) {rau (int i = 31; i> = 0; i--) {Tlc.set (i, 4095); Tlc.update (); ncua (50); } theem = 8; suav = 0; } lwm {++ suav; } tawg; // ----- Theem 9 rooj plaub 8: rau (int i = 31; i> = 0; i--) {Tlc.set (i+8, 4095); Tlc.set (kuv+7, 2000); Tlc.set (kuv+6, 1000); Tlc.set (kuv+5, 500); Tlc.set (kuv+4,300); Tlc.set (kuv+3,200); Tlc.set (kuv+2,100); Tlc.set (kuv+1,50); Tlc.set (i, 0); Tlc.update (); ncua (50); } rau (int i = 31; i> = 0; i--) {Tlc.set (i, 4095); } Tlc.update (); ncua (10); yog (suav> 8) {ncua (8000); Tlc.clear (); Tlc.update (); theem = 0; suav = 0; } lwm {++ suav; } tawg; }}

Kauj Ruam 7: Npog Lub thawv rau Cov Khoom Siv Hluav Taws Xob

Npog Npog rau Cov Khoom Siv Hluav Taws Xob
Npog Npog rau Cov Khoom Siv Hluav Taws Xob

Tom qab koj tau txheeb xyuas tias txhua yam ua haujlwm tau zoo siv cov cai saum toj no tam sim no koj yuav tsum ua tiav txoj haujlwm los ntawm kev ua lub hau npog rau cov khoom siv hluav taws xob. Kuv tau ua qhov ntawd siv qee qhov ntxiv ntawm cov ntawv fiberboard thiab ua ke lawv ua ke rau kev tsim lub thawv. Nyob rau sab nraum qab ntawm lub thawv koj yuav tsum ua ob lub qhov, ib qho rau lub hwj chim txuas thiab lwm qhov rau kev hloov.

Thaum kawg txhua yam koj yuav tsum ua yog luam koj daim duab, ntxiv rau lub thav duab, ruaj ntseg nws thiab koj ua tiav!

Kuv vam tias koj yuav nyiam txoj haujlwm no. Yog tias yog li, rau cov phiaj xwm txias thiab qhia ntau ntxiv, koj tuaj yeem tshawb xyuas kuv lub vev xaib raug cai, www. HowToMechatronics.com thiab ua raws kuv hauv Facebook.

Pom zoo: