Cov txheej txheem:

3x3x3 LED Cube Nrog Arduino Lib: 4 Kauj Ruam (nrog Duab)
3x3x3 LED Cube Nrog Arduino Lib: 4 Kauj Ruam (nrog Duab)

Video: 3x3x3 LED Cube Nrog Arduino Lib: 4 Kauj Ruam (nrog Duab)

Video: 3x3x3 LED Cube Nrog Arduino Lib: 4 Kauj Ruam (nrog Duab)
Video: Arduino Shield Üretiyoruz! HaberDuino LiPo Shield || JLCPCB #1 2024, Kaum ib hlis
Anonim
3x3x3 LED Cube Nrog Arduino Lib
3x3x3 LED Cube Nrog Arduino Lib

Muaj lwm Cov Lus Qhia txog kev tsim cov khoom siv LED, qhov no yog qhov sib txawv rau ntau qhov laj thawj: 1. Nws tau tsim nrog tus lej qis ntawm cov khoom lag luam tawm ntawm lub txee thiab txuas ncaj qha mus rau Arduino. 2. Ib qho meej, yooj yim rau kev tsim cov duab kos hauv Circuit Court tau muab nrog duab ntau. 3. Ib txoj hauv kev tshwj xeeb yog siv rau cov software uas ua rau lub programming lub voos xwmfab yooj yim dua thiab nthuav tawm ntau dua. Qhov xav tau: - 1 Perfboard - 3 NPN Transistors (2N2222, 2N3904, BC547, thiab lwm yam) - 12 Resistors (~ 220 ohms thiab ~ 10k ohms) - 13 Headers (txiv neej lossis poj niam) - 27 LEDs - Hlau

Kauj Ruam 1: Npaj cov LEDs

Npaj cov LEDs
Npaj cov LEDs
Npaj cov LEDs
Npaj cov LEDs

Cov kauj ruam no feem ntau ua raws LED Cube 4x4x4 tab sis peb yuav tsim lub 3x3x3 lub voos xwmfab xwb. Lub voos xwmfab ntawm qhov loj me no yog hais txog qhov loj raws li nws tau txais yam tsis qhia txog kev sib txuas ntxiv thiab nyuaj. Peb yuav xav tau tag nrho ntawm 27 LEDs uas yuav muab faib ua peb pawg ntawm cuaj. Kuv yuav xa mus rau txhua pawg no ua "qib". Txhua ntawm cuaj LEDs ntawm ib qib tau txuas nrog LED sib xws ntawm lwm ob qib los ntawm lawv cov anodes (coj zoo). Cov no yuav raug xa mus rau "kab". Yog tias qhov tsis nkag siab nws yuav dhau los piav qhia tus kheej thaum peb tsim lub voos xwmfab. Txhawm rau pib peb yuav siv lub laum los tsim jig tawm ntawm cov ntoo me me. Lub jig yuav tuav cov LEDs nyob rau hauv qhov chaw thaum peb muab lawv pov rau lawv. Kuv txiav txim siab tso cov qhov nyob ib ncig 5/8 ntawm ib nti sib nrug (~ 15 hli) tab sis qhov nrug deb tsis yog qhov tseem ceeb. Lub qhov yuav tsum muaj qhov nruj nruj nyob ib puag ncig LED txij li peb tsis xav kom lawv txav mus los thaum siv qhov muag. Li thaum lub jig ua tiav peb yuav khoov cov cathode ntawm txhua LED hauv 90 degree lub kaum ntse ntse. Cov cathode yog tus tuaj yeem txheeb xyuas tau hauv peb txoj hauv kev: 1) Nws yog tus ceg luv dua, 2) Nws nyob sab tiaj ntawm ib puag ncig LED, 3) nws txuas nrog rau qhov loj dua sab hauv LED. Nco ntsoov tias koj khoov cov cathode nyob rau tib qho kev taw qhia rau tag nrho cov LEDs.

Kauj Ruam 2: Siv cov LEDs

Solder cov LEDs
Solder cov LEDs
Solder cov LEDs
Solder cov LEDs
Solder cov LEDs
Solder cov LEDs
Solder cov LEDs
Solder cov LEDs

Thawj qhov cuaj ntawm LEDs hauv koj lub jig ua tshiab. Muab lawv tso kom ob txhais ceg taw mus rau tib qho kev taw qhia-clockwise. Cov duab qhia cov cathode taw tes rau ntawm lub kaum sab xis nrog lub anode tig tawm, tab sis kuv yuav tig lub LEDs ib ncig yog tias kuv tau ua nws dua txhawm rau ua kom cov ceg tsis txhob cuam tshuam qhov pom ntawm LED. Muab ob sab tso ua ke, ib khub ntawm txhua sab. Siv cov ntawv me me kom ua rau ob txhais ceg txuas ua ke thaum thov cov laug. Thaum txhua qhov ntawm plaub sab raug laug, txav cov kab ntawv los tuav cov ces kaum ua ke thiab siv cov laug rau txhua tus. Thaum kawg, muab cov cathode ntawm nruab nrab LED rau ib sab thiab txiav tawm qhov tshaj. Rov ua peb zaug. Tam sim no koj yuav tsum muaj peb txheej ntawm cuaj LEDs. Muab ob txoj kab ntawm ib qho tso rau saum lwm qhov. Khaws qhov nrug sib npaug rau qhov sib nrug twb tau tsim los ntawm LEDs. Thaum koj xis nyob nrog qhov sib nrug koj tuaj yeem clamp txhua txheej ntawm ob txhais ceg siv ob qhov clip, ib qho ntawm txhua qhov kev coj, kom ua kom ob txhais ceg ruaj khov nyob rau hauv qhov chaw thaum siv cov laug. Koj yuav tsum tau khoov ib puag ncig LED kom tau txais kev sib txuas zoo. Solder txhua ntawm cuaj khub, ib leeg zuj zus. Ua qhov no ib zaug ntxiv thiab koj tau ua tiav nrog lub voos xwmfab. Muab lub voos xwmfab tso rau ntawm ib sab ntawm lub perfboard. Nco ntsoov tias cuaj ceg nyob sib nrug sib npaug thaum koj coj txhua tus los ntawm lub qhov. Kuv lub rooj tsavxwm muaj tsib qhov nruab nrab ntawm txhua txheej ntawm ob txhais ceg. Koj xav tawm hauv chav kom ntau li ntau tau nyob rau lwm qhov kawg ntawm perfboard kom haum rau ntau yam khoom siv. Ntxiv ob peb daim yeeb yaj kiab los tuav ob txhais ceg hauv qhov chaw thaum koj zoo siab nrog kev tso chaw. Tawm ntawm txhais ceg ntau dhau los hauv qab txij li qhov no yuav ua rau nws yooj yim dua rau cov laug cov neeg tawm tsam tom qab. Tig lub Rooj Tswjhwm Saib dua thiab muab txhuam ntawm ob txhais ceg kom lawv nyob hauv qhov chaw. Tig lub voos xwmfab rov qab dua thaum tag nrho ob txhais ceg tau muag. Thaum kawg peb yuav tsum tau muab cov hmoov txhuas los ntawm txhua qib qis mus rau hauv qab ntawm lub rooj tsavxwm. Seem ib daim hlau thiab khoov tus nqaj me me ntawm ib kawg. Dai tus nuv rau ntawm ib qho ntawm qhov nruab nrab LEDs ob txhais ceg thiab coj nws hla lub qhov ntawm lub perfboard. Tuav tus nuv kawg kom cov xaim nyob hauv qhov chaw. Rov ua dua rau lwm ob qib. Cov kauj ruam tom ntej yog tsim kom muaj qhov seem hauv Circuit Court.

Kauj ruam 3: Tsim Circuit Court

Tsim Circuit Court
Tsim Circuit Court
Tsim Circuit Court
Tsim Circuit Court
Tsim Circuit Court
Tsim Circuit Court
Tsim Circuit Court
Tsim Circuit Court

Lub voj voog yog yooj yim zoo nkauj. Txhua ntawm cuaj kab yuav txuas rau tus pin ntawm Arduino los ntawm kev txwv tam sim no. Txhua ntawm peb qib txuas rau hauv av ntawm NPN transistor thaum qhib los ntawm tus pin Arduino. Peb yuav siv 12 tus pin tso tawm tag nrho ntawm Arduino tab sis muaj 18 LEDs rau lub zog. Qhov ua kom yuam kev yog tias tsuas yog ib qib tuaj yeem tso tawm ib zaug. Thaum ib qib txuas nrog hauv av, txhua qhov LEDs ntawm qib ntawd tuaj yeem ua haujlwm ib tus zuj zus los ntawm ib ntawm cuaj lwm Arduino tus pin. Yog tias peb teeb cov theem nrawm txaus nws yuav tshwm zoo li yog tias peb qib tau taws tib lub sijhawm. Cia peb tsim lub voj voog. Thawj kauj ruam yog los npaj cuaj tam sim no txwv kev tiv thaiv. Kuv siv 220 ohms rau tus pin uas yuav kos ib ncig 22mA. Tus nqi yuav txawv nyob ntawm LEDs uas tau siv tab sis nyob nruab nrab ntawm 135 thiab 470 ohms. Txhua tus pin muaj peev xwm nrhiav tau txog 40mA. Txhawm rau kom txuag tau chav peb xav kom muab cov tshuaj tiv thaiv nyob hauv txoj haujlwm ntsug. Khoov ib txoj kab nqes kom ob txoj kab sib luag sib luag. Ua qhov no rau tag nrho cuaj ntawm cov neeg tawm tsam. Thaum cov resistors tau npaj txhij peb yuav solder lawv ib tus zuj zus. Txhawm rau kom yooj yim peb tab tom yuav solder tus resistor coj ncaj qha mus rau lwm yam khoom siv es tsis txhob siv cov xaim cais rau txhua tus. Ib kawg ntawm tus tiv thaiv yuav txuas rau ib kem thiab lwm qhov yuav txuas rau lub taub hau. Pib nrog thawj kab ntawm LEDs uas ze tshaj rau cov neeg tawm tsam thiab ua haujlwm koj txoj kev rov qab. Thaum txhua kab ua tiav koj tuaj yeem siv daim kab xev me me los cais cov kab sib tshooj ua ke txhawm rau tiv thaiv kom luv. Xa mus rau cov duab thiab daim duab kom pom qhov no yuav zoo li cas thaum nws ua tiav. Tam sim no hais tias cov kab tawm ntawm txoj kev, cov kauj ruam tom ntej yog txhawm rau ua cov khoom siv uas tswj hwm qib. Lub hauv paus ntawm NPN transistor yuav qhib los ntawm tus pin Arduino los ntawm kev txwv tam sim no ntawm 10k (lossis nyob ntawd). Qhov no yuav txuas qib sib xws rau hauv av uas yuav tso cai rau tam sim no ntws los ntawm LEDs. Xa mus rau cov duab thiab daim duab. Thaum ua tiav cov LEDs yuav tsum txuas rau tus pin 2-10 ntawm Arduino thiab qib yuav tsum txuas rau tus pin 11-13, hauv qab mus rau saum. Cov pins kuj tseem tuaj yeem teeb tsa hauv software yog tias koj xav tau teeb tsa sib txawv. Tam sim no lub voj voog tiav, lub sijhawm txav mus rau software!

Kauj ruam 4: Siv Software

Siv Software
Siv Software
Siv Software
Siv Software

Kuv pom ob peb tus lej piv txwv ntab ncig 'net rau kev tswj hwm lub voos xwmfab LED. Lawv txhua tus xav tau cov ntaub ntawv loj ntawm binary lossis hex cov ntaub ntawv los tswj cov LEDs. Kuv xam tias yuav tsum muaj txoj hauv kev yooj yim dua yog li kuv tau teeb tsa los sau kuv tus kheej software. Kuv thawj qhov kev txiav txim siab yog ua kom daim iav tsom iav kho vajtse. Qhov ntawd txhais tau hais txog txhua tus LED los ntawm kab ntawv thiab qib tsis siv cov ntaub ntawv chaw nres nkoj nyoos lossis cov tsoos x, y, z. Qhov kev txiav txim siab thib ob yog pib nrog kev ua haujlwm yooj yim, zoo li tig ib lub teeb rau lossis tua, thiab txhim tsa los ntawm qhov ntawd. Thaum kawg kuv txiav txim siab los qhia ob yam uas muaj txiaj ntsig zoo rau cov txiaj ntsig zoo dua. Ib qho yog qhov tsis zoo uas tso cai rau cov haujlwm yooj yim los tsim cov qauv nyuaj dua. Lwm qhov yog cov haujlwm ua ntu zus uas teeb ib qho ntawm LEDs ib zaug, lossis tag nrho ib zaug. Lub tsev qiv ntawv pib raws li txheej txheem txheej txheem thiab ua haujlwm tsis txaus. Los ntawm qhov ntawd nws yooj yim heev los ua raws cov lus qhia los tsim lub tsev qiv ntawv Arduino rov qab siv tau. Nco ntsoov rub lub tsev qiv ntawv thiab unzip nws rau sketchbook/tsev qiv ntawv. Yog teeb tsa kom raug koj yuav tsum pom ib qho piv txwv hauv Arduino software hauv File> Piv txwv> LedCube> ledcube. Txoj cai tseem muaj nyob ntawm Github ntawm gzip/arduino-ledcube. Tsaug rau kev nyeem ntawv!

Pom zoo: