Cov txheej txheem:

Qhov Chaw Invaders Moos (ntawm Pob Nyiaj!): 6 Cov Kauj Ruam (nrog Duab)
Qhov Chaw Invaders Moos (ntawm Pob Nyiaj!): 6 Cov Kauj Ruam (nrog Duab)

Video: Qhov Chaw Invaders Moos (ntawm Pob Nyiaj!): 6 Cov Kauj Ruam (nrog Duab)

Video: Qhov Chaw Invaders Moos (ntawm Pob Nyiaj!): 6 Cov Kauj Ruam (nrog Duab)
Video: Tswv Yexus lub neej thaum pib txug thaum xaus 2024, Hlis ntuj nqeg
Anonim
Image
Image
Sib Sau
Sib Sau

Tsis ntev los no kuv pom qhov txias tsim los ntawm GeckoDiode thiab kuv tam sim xav tsim nws tus kheej. Cov Lus Qhia yog Space Invaders Desktop Clock thiab kuv pom zoo kom koj saib nws tom qab nyeem qhov no.

Txoj haujlwm yuav luag ib txwm ua los ntawm cov khoom siv los ntawm Adafruit nrog lub tshuab luam ntawv 3D, thiab laser txiav lub ntsej muag. Ntxiv txhua yam nce tus nqi ntawm kev tsim ua kim heev! (ncig £ 100 lossis ntau dua). Qhov teeb meem yog tias koj tsis muaj lub tshuab luam ntawv 3D koj yuav tsum tau them kom tau koj tus qauv luam tawm, lossis yuav ib lub thawv tsis zoo tawm ntawm ebay uas feem ntau tsuas yog me me xwb, nqaim dhau, kom luv, lossis qhov sib txawv.

Feem ntau ntawm kuv qhov kev tsim yuav tsum tau ua tiav ntawm cov peev nyiaj nyiam ua haujlwm thiab cov ntaub thaiv ib txwm dhau los ua qhov kim tshaj plaws. Yog li kuv txiav txim siab los tsim tib lub moos tab sis ntawm pob nyiaj siv ncaj ncees.

Yog tias koj txaus siab saib lub moos txawv txawv, txheeb xyuas kuv Steampunk Voltmeter Clock, uas siv tib cov khoom tsim rau lub thawv:-)

Kauj Ruam 1: Sau Qhov Chaw

Txhawm rau ua txoj haujlwm no koj yuav xav tau cov hauv qab no. Nco ntsoov nrog cov ntaub ntawv rau lub thawv ntawv koj yuav muaj TXHUA ntawm cov laug uas koj tuaj yeem siv hauv lwm qhov haujlwm (uas ua rau tus nqi tsim yav tom ntej txawm tias pheej yig dua). Kuv tau tshaj tawm PDF cov khoom uas koj xav tau yog tias koj xav txheeb xyuas tus nqi thiab lwm yam ntawm ebay.

Cov cuab yeej (Kuv xav tias koj yuav muaj cov no lawm)

  • Soldering hlau
  • Solder
  • Cov twj tso kua mis (yog tias koj ua yuam kev thiab xav tau tshem cov laug)
  • Kub kua nplaum phom
  • Kub nplaum nplaum
  • Khoom siv tes ua riam (aka stanley knife)
  • Tus kav / ntsuas kab xev / Vernier caliper
  • Cordless laum + laum ntsis (1 hli txog 13 hli)
  • Rotary multi-tool nrog txiav disc (aka Dremel)
  • Ntxuav cov kua zoo li Isopropyl-cawv (pheej yig tom qab ua haujlwm ib yam nkaus)
  • Daim npog ntsej muag kev nyab xeeb (siv thaum pleev xim)

Electronics (Tus nqi hluav taws xob =.0 13.05)

Qee qhov no kuv tau pub dawb. Cov khoom siv hluav taws xob qub muaj cov hais lus Mylar zoo sab hauv yog tias koj coj lawv sib nrug. Thaum koj nyob ntawd koj tuaj yeem zaum tau txais lub thoob DC thiab lub laub khawm ib yam nkaus.

  • Dupont / Jumper cables - £ 0.99
  • DS1307 Lub sijhawm teev lub sijhawm tiag tiag - £ 0.99 (Kuv xav kom tau txais DS3231 hloov chaw uas muaj)
  • Arduino nano + usb cable - £ 2.23
  • 8 Ohm Mylar hais lus - £ 0.99
  • SPST lub sijhawm thawb khawm - £ 1.49
  • 5.5mm DC chim lub qhov (socket) - £ 1.26
  • 5v, 0.5A DC fais fab mov - £ 2.83
  • MAX7219 Dot matrix zaub - £ 3.76

Cov Ntaub Ntawv (Tus nqi ntawm cov ntaub thaiv npog = £ 17.19)

  • 60mm square cov raj xa dej - £ 5.99 (koj yuav muaj ntau ntawm qhov no ntxiv rau ntau txoj haujlwm)
  • Cov tshuaj tsuag xim dub - £ 4.85
  • Dub PVC (foamboard) - £ 2.99
  • Super kua nplaum - £ 0.99
  • 60mm kawg lub kaus mom - £ 2.37

Tus nqi tag nrho = £ 30.24:-) …….. raws li hnub no qhov no yog sib npaug ntawm 38 USD rau ib tus neeg nyeem thoob ntiaj teb.

Kuv nyiam ua haujlwm nrog PVC cov yeeb nkab square. Lawv yooj yim rau laum, txiav, pleev xim, thiab kuv tau siv ib qho rau kuv Steampunk moos.

Kauj Ruam 2: Npaj Koj Cov Yeeb Nkab

Npaj Koj Dej Yeeb Nkab
Npaj Koj Dej Yeeb Nkab

Kos tawm qhov twg koj xav tso khoom

Qhov no yooj yim heev. Kuv tsis tau siv dab tsi zoo nkauj. Ua ntej kuv txiav 2.5 m qhov ntev mus rau qhov tsim nyog me me rau kuv lub rooj ntev zaum hauv tsev (li 30 cm) nrog lub hack pom. Kuv tom qab txiav qhov no nrog lub dremel kom cov npoo zoo thiab ncaj. Tom qab ntawd kuv tau so cov khoom nyob saum npoo ntawm cov yeeb nkab thiab siv kev lag luam ruaj khov los cim qhov twg kuv xav laum thiab txiav. Kuv taug ib puag ncig sab nraum ntawm LED matrix, thiab siv cov cuab yeej sib hloov ntau yam los txiav ib lub qhov rau nws kom haum cov yaug. Kuv siv lub ntsuas ntsuas digital los ntsuas txoj kab uas hla ntawm lub laub khawm thiab DC chim txhawm rau txiav qhov qhov me me kom raug nyob tom qab thiab sab saum toj.

Txiav ib bezel

Kuv muaj cov ntim PVC ua npuas ncauj tso ncig los ntawm cov haujlwm yav dhau los. Lawv yog qhov zoo rau kev teeb tsa cov kab hluav taws xob rau hauv cov thawv ntawv, siv nws los sib xyaw epoxy ua ke ntawm nws, thiab ua lwm yam khoom me me thiab bobs. Siv A4 lossis A5 daim me me thiab txiav ib lub xwmfab 5 hli puag ncig lossis bezel txhawm rau teeb tsa cov lej LED. Qhov no yuav zais qee qhov kev yeej uas koj tau ua thaum txiav lub qhov square rau cov lej. Txog qhov no kuv kos tus qauv me me ntawm Inkscape thiab luam tawm nws (SVG Cov Ntaub Ntawv txuas). Tom qab ntawd kuv tau kaw nws nrog daim kab xev npog rau lub foamboard thiab ua tib zoo txiav ib ncig nws nrog riam riam. Nws yog qhov nyuaj kom tau txais txoj cai, Kuv pom zoo kom txiav sab hauv ua ntej ces sab nraud.

Pleev xim txhua yam

Thaum tag nrho cov qhov drilled thiab txiav, tshem tawm ib qho burred npoo. Ntxuav qhov chaw nrog qee cov cawv so kom tshem tawm cov hmoov av lossis pa phem (lossis qee qhov pheej yig tom qab yog tias koj tsis muaj IPA). Sim thiab tshuaj tsuag rau thaj chaw uas muaj cua nkag tau zoo thiab siv daim npog qhov ncauj ua tau. Kuv tau ua qhov no sab nraum nrog qee cov duab los qhia rau hauv pem teb tab sis nws tsis zoo, txawm tias cua me me tuaj yeem ua rau cov xim ya rov qab rau hauv koj lub ntsej muag. Ceev faj thiab hnav cov cuab yeej tiv thaiv qhov ua tau.

Txau cov yeeb nkab, bezel, thiab lub kaus mom kawg kom lawv txhua yam zoo ib yam dub, tom qab ntawd cia kom qhuav li ob peb teev.

Kauj ruam 3: Program Arduino

Program Arduino
Program Arduino

Qee cov ntaub ntawv hais txog txoj cai

Tso nyiaj rau GeckoDiode raws li kuv tau coj nws cov cai thiab hloov kho nws ua haujlwm nrog MAX7219 nti. Adafruit version siv I2C npav thiab MAX siv SPI npav. Txog qhov no kuv tau siv MaxMatrix lub tsev qiv ntawv, uas kuv rub tawm thiab teeb tsa rau hauv Arduino IDE. Yog tias koj xav kawm paub ntau ntxiv txog MaxMatrix thiab yuav ua li cas cov lej LED ua haujlwm hauv tus thawj xibfwb muaj cov lus qhia luv luv ntawm HowToMechatronics.com. LED matrix tsuas yog ua los ntawm ib qho xim ntawm LED ntau dua li muaj cov xim ntau xim.

Ib qho kev poob siab uas kuv muaj yog tias tsis muaj cov ntsiab lus tseeb ntawm lub luag haujlwm yog rau lub tsev qiv ntawv yog dab tsi thiab cov lus sib cav xav tau yuav dhau mus rau txhua qhov. Luckily Kuv muaj peev xwm nrhiav pom dab tsi ua los ntawm kev sim thiab ua yuam kev thiab thaum kawg nws tsis nyuaj heev kom nws ua haujlwm kom raug. Thawj qhov kom nkag siab yog tias koj yuav tsum txiav txim siab pes tsawg 8x8 cov qauv nyob hauv koj cov lej. Hauv kuv tus lej qhov no tau khaws cia rau hauv cov lej hu ua "modules" zoo li no:

"int modules = 4;"

Nov yog NQI ntawm 8x8 cov qauv koj tau txuas ua ke hauv koj cov zaub. Tsis yog tus naj npawb ntawm LED lossis tus lej twg koj tab tom siv cov ntaub ntawv xa khoom. Qhov tom ntej yuav tsum nco ntsoov yog tias koj "sprite" lossis ib qho twg npog tag nrho plaub qhov kev kawm tom qab ntawd cov byte array xav tau txhais raws li no:

"byte text_start_bmp = {32, 8, …*qee cov ntaub ntawv byte*…};"

Cov zauv qhia txog tus nqi ntawm kab thiab kab hauv matrix. Lub sijhawm no byte lub npe "text_start_bmp" tau nthuav tawm ntau dua 32 kab thiab 8 kab. Cov lej tsuas yog tso tawm ntawm ib qho 8x8 matrix thiaj li feeb feeb 10 zoo li no:

"byte feeb_ten_bmp = {8, 8, …*qee cov ntaub ntawv byte*…};"

Cov neeg tuaj txawv teb chaws npog ob daim ntawv kawm tiav yog li byte yuav muab 16, 8 hauv cov ntaub ntawv byte.

Lwm qhov uas ntes kuv tawm yog qhov chaw ntawm cov ntaub ntawv sprite. Koj tuaj yeem nug Arduino kom tso saib cov kab mob sib txawv hauv X/Y txoj haujlwm sib txawv ntawm cov lej los ntawm txoj haujlwm hauv tsev tsis raug. Cov cai zoo li no rau feeb feeb:

"matrix.writeSprite (8, 0, feeb_zero_bmp);"

Ib tus lej yog X hloov kho thiab lwm tus yog Y. Tsis nco qab tias tus twg yog leej twg tam sim no, tab sis yog tias koj xav nudge tus sprite nce lossis nqis los ntawm 1 kab lossis kab koj tsuas yog nce tus lej zoo lossis rho tawm. Yooj yim txaus rau 8x8 matrix tab sis thaum koj tus sprite npog ntau dua ib qho matrix koj yuav tsum teeb tsa txoj haujlwm hauv tsev kom haum. "POP" sprite tau qhia hauv qab no:

"matrix.writeSprite (16, 0, invader_pop_bmp);"

Daim ntawv ceeb toom tam sim no li cas txoj hauj lwm hauv tsev yog 16 tsis yog 8? Ntawm no tus lej yog qhia tus sprite tau tshwm ntawm sab laug mus rau sab xis los ntawm txoj haujlwm kab/kem 16. Nws txiav txim siab ob 8x8 cov lus los ua ib qho 16x8 zaub txawm hais tias muaj 4! Yog li ntawd nws yog ib qho tseem ceeb xav txog tias muaj pes tsawg tus lus qhia tus sprite yuav raug nthuav tawm thoob plaws thiab ntsuas txhua tus sprite's byte array raws li. Txwv tsis pub koj yuav muaj qee qhov sprites nthuav heev!

TSO 1307 RTC

Txawm hais tias DS1307 ua haujlwm tau zoo nrog Adafruit RTClib.h lub tsev qiv ntawv, koj tsis tuaj yeem teeb tsa lub sijhawm uas tsuas yog mob. Kuv nyuam qhuav mus nrog qhov no vim tias nws txhais tau tias tsawg dua txoj cai los hloov. DS1307 teeb tsa lub sijhawm siv sijhawm thiab hnub tim tus lej tau suav los ntawm koj lub computer. Hloov chaw kawm siv lub tsev qiv ntawv DS3231 thiab teeb nws ib zaug rau ib lossis ob feeb ua ntej yav tom ntej. Nws kuj muaj tsawg dua "drift" yog li nws khaws sijhawm zoo dua lub sijhawm. Ob qho qauv siv I2C npav thiab kuv ntseeg tias DS3231 tuaj yeem siv nrog RTClib.h yog tias koj mob siab siv nws txuas ntxiv mus.

Upload cov cai

Thaum koj zoo siab nrog tus lej xa nws mus rau Arduino. Kuv tau txuas kuv daim duab Arduino rau koj qhov kev txiav txim siab.

Kauj Ruam 4: Sib Sau Cov Khoom Siv Hluav Taws Xob

Sib dhos Electronics
Sib dhos Electronics

Whilst uploading cov cai Kuv xav kom muaj cov khoom siv hluav taws xob sib sau ua ke nrog dupont/jumper xov ntawm lub khob cij ua ntej yog li thaum koj tso cov cai koj paub txhua yam ua haujlwm raws li lub hom phiaj xav tau. Qhov no tso cai rau koj kom tshem tawm txhua qhov teeb meem nrog kev nthuav tawm cov sprites thiab lwm yam ua ntej koj pib gluing thiab lo. Hauv kuv tus lej koj tuaj yeem pom kuv tab tom siv tus lej digital 4, 5, 6, 7, 9, tab sis koj tuaj yeem hloov cov no yog tias tsim nyog. Koj yuav xav tau txuas cov hlua txuas mus rau lub pob, DC nkaus, thiab Hais Lus tab sis feem ntau yuav tsum yog yooj yim thawb haum cov qauv sib txuas.

Thaum koj zoo siab cov khoom siv hluav taws xob ua haujlwm raws li lub hom phiaj koj yuav tsum txiav txim siab siv qhov sib txuas. Koj tuaj yeem ua qhov no nrog tooj liab stripboard/veroboard, tab sis rau qhov me me ntawm cov khoom koj tuaj yeem tso ncaj qha rau tus pin ntawm Arduino. Nws yuav zoo li nas zes tab sis tsis muaj leej twg yuav pom sab hauv lub thawv thaum nws tau sib sau ua ke lawm, tsuas yog ua kom ntseeg tau tias txhua qhov ntawm cov hlau tau raug cais, koj tsis xav tau dab tsi luv hauv rooj plaub.

Kuv tau ua kom lub laub khawm ua haujlwm thaum tus "mainButton" tus pin rub qis. Kuv pom Arduino tau lees paub qhov tsis raug thawb khawm nias thaum ntab hluav taws xob khom ntawm nws. Siv lub 10K pulldown resistor ntawm lub laub khawm thiab teeb tus pin rau "INPUT_PULLUP" daws qhov teeb meem ntawd rau kuv.

Txuas nrog yog cov txheej txheem hauv PDF thiab-p.webp

Kauj Ruam 5: Tua Hluav Taws Xob thiab Kaw Tawm

Mount Cov Khoom Siv Hluav Taws Xob thiab Kaw
Mount Cov Khoom Siv Hluav Taws Xob thiab Kaw
Mount Cov Khoom Siv Hluav Taws Xob thiab Kaw
Mount Cov Khoom Siv Hluav Taws Xob thiab Kaw

Txog kuv lub moos kuv tau teeb tsa cov khoom siv hluav taws xob siv cov kua nplaum kub, tab sis ceev faj tsis txhob siv ntau dhau (cov khoom siv hluav taws xob tsis nyiam ua kom sov ntev ntev). Kuv siv qhov me me ntawm cov kua nplaum super dotted ncig lub bezel thiab nias nws tawm tsam sab xub ntiag. Kuv ua tiav qhov thaiv los ntawm kev thawb lub hau kawg ntawm txhua qhov kawg. Tau kawg koj tuaj yeem lo lub kaus mom kawg kom kaw qhov kev sib dhos, tab sis kuv sab ib sab ntawm kuv qhib yog li kuv tseem tuaj yeem nkag mus rau USB chaw nres nkoj ntawm arduino txhawm rau rov pib hnub thiab sijhawm yav tom ntej.

Kauj ruam 6: Txaus siab rau

Txaus siab rau
Txaus siab rau
Txaus siab rau
Txaus siab rau

Zuag qhia tag nrho kuv zoo siab nrog txoj kev no tawm los, txiav txim siab nws tsuas yog qee cov kav dej thiab cov tshuaj tsuag. Kuv vam tias koj nyiam nws thiab qhia rau kuv paub yog tias koj tuaj yeem xav txog ib qho kev hloov pauv txias uas tuaj yeem muab ntxiv. Kuv yuav xav paub yog tias leej twg tuaj yeem ua qhov no pheej yig dua lossis yog tias muaj lwm txoj hauv kev ua kom ruaj khov kuv tuaj yeem sim hauv kuv qhov haujlwm tom ntej.

Pom zoo: