Cov txheej txheem:
- Kauj Ruam 1: Cov khoom siv
- Kauj Ruam 2: Accelerometer Code rau CPX
- Kauj ruam 3: Ntxiv Servo Code
- Kauj Ruam 4: Txuas Servos rau CPX
- Kauj Ruam 5: Tsim Qauv Tis
- Kauj Ruam 6: Txuas Tis rau Cov Tsav Tsheb
- Kauj Ruam 7: Hloov Kho zaum kawg
Video: Tsab ntawv tsa suab qhib cosplay tis siv Circuit Chaw Ua Si Qhia - Tshooj 1: 7 Cov Kauj Ruam (nrog Duab)
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:24
Qhov no yog ib feem ntawm ob qhov haujlwm, uas kuv yuav qhia koj kuv cov txheej txheem rau ua ib khub ntawm cov tis zoo nkauj tsis siv neeg.
Thawj ntu ntawm txoj haujlwm yog kev siv tshuab ntawm tis, thiab ntu ob yog ua kom nws hnav tau, thiab ntxiv tis lawv tus kheej.
Qhov no yog ib feem, cov neeg kho tshuab liab qab. Thaum koj ua tiav nrog ntu no, koj tuaj yeem txav mus rau Ntu 2!
Kauj Ruam 1: Cov khoom siv
Rau ib feem ntawm txoj haujlwm no, koj yuav xav tau:
- 1 x Circuit Court Chaw Ua Si Express
- 2 x Txheem servo motor
- Breadboard (tsis-soldering rau kev sim)
- Lub zog siv hluav taws xob (Kuv siv 4xAA lub roj teeb tuav, tab sis koj tuaj yeem siv txhua yam ua haujlwm rau koj)
- USB rau micro USB chord
- 4 x Alligator clip rau txiv neej lub taub hau
- Cov xov (nrog txiv neej lub taub hau)
Cov khoom siv hauv qab no yog nyob ntawm yeem, thiab rau kev ua qauv tis los sim tawm koj txoj haujlwm:
- Hnab ntawv lossis Cardboard
- Cwj mem
- Sharpie/tus cim
- Popsicle sticks
- Daim kab xev lossis kua nplaum kub
- Txiab lossis riam X-Acto
Kauj Ruam 2: Accelerometer Code rau CPX
Ua ntej tshaj, koj yuav tsum teeb tsa Lub Chaw Ua Si Hauv Circuit's accelerometer, vim tias cov tis yuav txav raws qhov txav ntawm tes.
Tam sim no, yog tias koj tab tom ua txoj haujlwm no, koj tuaj yeem sim nrog lub suab, lub teeb, txhua tus lej ntawm yam uas ua rau cov tis txav mus los zoo ib yam li kev ua kom zoo dua qub thiab nqes los ib sab. Txog rau txoj haujlwm no, txawm li cas los xij, Kuv tau xaiv kom muaj tis txav nrog koj txhais tes: thaum txhais tes taw tes, tis nce mus, thiab hloov pauv.
Rau qhov pom tseeb, peb yuav siv cov neopixels los pab peb txheeb xyuas seb puas yog lossis tsis yog CPX cov cai ua haujlwm raug. Nco ntsoov khaws txoj haujlwm no thoob plaws hauv cov txheej txheem, lossis koj yuav tsum tau rov pib dua los ntawm txhua qhov chaw nws pib khaws cia zaum kawg, uas kuv pom tshwj xeeb yog kev ntxhov siab.
Pib nrog txoj haujlwm MakeCode tshiab. Lub npe tuaj yeem yog txhua yam uas koj xav tau, tab sis kuv qhia qee yam ntsig txog lub zog-qhib tis kom nws yooj yim mus nrhiav tom qab. Tsis txhob tshem tawm txoj haujlwm tas mus li. Tsim cov phiaj xwm pib los ntawm kev siv qhov "pib" thaiv, thiab ntxiv qhov chaw ntsuas qhov ntsuas thiab teeb duab. Cov duab ua haujlwm nrog lub ntsuas ntsuas ntsuas qhov chaw ntawm CPX cuam tshuam nrog hauv av siv lub ntiajteb txawj nqus.
Thaum uas tau teeb tsa, peb yuav tsum tau muab lub hom phiaj ntsuas kev ntsuas. Raws li kuv tau hais, hauv ntu 2 ntawm txoj haujlwm no CPX yuav txuas rau sab nraum qab ntawm txhais tes, thiab thaum txhais tes taw tes saum toj, tis yuav "nthuav tawm," thiab nqes mus yuav ua rau tis "quav". Yog li, hauv qhov thaiv ib txhis, ntxiv ob "yog" ua haujlwm, thiab hloov qhov "muaj tseeb" kev xaiv ntawm ob qho "Yog" thaiv nrog qhov tsis sib xws, nyob rau sab laug yog qhov ntsuas qhov ntsuas ntawm Y. Koj tuaj yeem ua si ib puag ncig nrog cov teeb duab saum toj no, tab sis qhov thaiv rau thaum qhov nrawm dua ntau dua tus lej yuav yog koj cov lus "nqis", thiab "tsawg dua" "yog" thaiv yuav yog koj cov lus tshaj tawm. Tsuas yog kom koj paub tias lub ntsuas hluav taws xob ua haujlwm, muaj xim ntawm neopixels hloov xim thaum CPX txav mus. Hauv qhov piv txwv no, Kuv tau siv liab rau qis thiab xiav rau saum.
Tshaj tawm cov cai rau koj CPX los ntawm kev txuas nws mus rau koj lub khoos phis tawj nrog USB qaum, thiab xyuas kom cov xim ua haujlwm raws li koj tau npaj tseg rau. Yog xav tau kev kho, xav tias dawb los ua.
Kauj ruam 3: Ntxiv Servo Code
Thaum cov xim ua haujlwm raws li koj xav kom lawv thaum koj qaij lub CPX, rov qab mus rau txoj cai, vim tam sim no peb tab tom yuav ntxiv cov kev pabcuam servo motor.
Mus rau Advanced tab hauv cov ntawv qhia zaub mov thaiv, thiab hauv qab Pins, nrhiav cov servo blocks. Muab ob qho "Servo sau" cov ntawv tso rau hauv txhua qhov yog cov lus hais nrog Neopixel cov lus txib, thiab teeb tsa lawv rau koj lub kaum sab xis tsawg kawg (qis tshaj koj lub tis yuav quav), thiab koj lub kaum sab xis siab tshaj (siab tshaj plaws lub tis yuav tsa). Kuv siv lub kaum 140 thiab 80 raws li qhia rau kev sim, vim qhov no yog kwv yees li lub kaum uas kuv xav kom tis txav mus.
Ib "Servo Sau" thaiv hauv txhua "yog" nqe lus yuav yog rau koj sab xis, thiab teeb tsa tus pin A1. Qhov no txhais tau tias lub tis sab xis yuav txuas rau A1 tus pin ntawm koj CPX, thiab yuav txav mus raws li cov lus qhia servo. Qhov "nce" servo hais kom ua rau sab xis yuav yog koj tus lej loj, 140 degrees hauv kuv qhov piv txwv. Tus nqi qis dua, 80 degrees, yog koj lub kaum sab xis rau sab xis thiab yuav ua haujlwm qis, tseem teeb tsa tus pin A1. Hloov cov txiaj ntsig no rau sab laug servo/thib ob servo sau thaiv hauv txhua nqe lus, txuas nrog tus pin A2 (140 rau qis, 80 rau nce). Nco ntsoov txuag koj txoj haujlwm!
Kauj Ruam 4: Txuas Servos rau CPX
Teem cov cai ib ntus, thiab cia peb tsim cov tshuab rau txoj haujlwm.
Siv koj lub lauj kaub tais diav uas tsis txhuam, txuas cov xov hlau thiab cov nab kuab raws li tau hais los saum no. Qhov no yog yuav ua li cas cov kab hluav taws xob yuav ua haujlwm hauv ntu 2 ntawm txoj haujlwm no, tsuas yog siv cov xov hlau tsawg dua kom muaj kev cog lus ntau dua.
Txuas cov servo motors raws li, thiab siv cov kais dej txuas, txuas rau CPX raws li qhia saum toj no. Nco ntsoov muab tus nab kuab txuas rau sab xis servo lub cev ntawm A1 thiab qhov txuas txuas rau sab laug servo lub cev muaj zog ntawm A2, lossis lwm yam raws li koj txoj cai.
Ntxiv "chij", lossis qee qhov taw qhia rau koj lub cav servo kom paub tseeb tias lawv tig mus raws txoj cai. Koj tsis xav tau dab tsi zoo nkauj, Kuv siv daim ntawv nplaum.
Rub tawm cov cai rau koj CPX, thiab txuas CPX rau lub zog siv hluav taws xob uas koj npaj rau siv rau qhov haujlwm kawg. Tam sim no sim nws! Nco ntsoov tias thaum koj CPX cov ntsiab lus nce mus, servo "chij" nce mus, thiab thaum koj CPX cov ntsiab lus qis qis, cov chij nqis mus.
Kauj Ruam 5: Tsim Qauv Tis
Ua siab ncaj, cov no yog nyob ntawm yeem. Kuv pom zoo ua qhov no, txawm li cas los xij, txhawm rau sim koj cov servos nrog cov khoom loj ib yam thiab qhov hnyav sib xws rau qhov txiaj ntsig kawg, los pab koj ua qhov kev hloov kho tsim nyog thaum lub sijhawm ib feem ntawm txoj haujlwm no. Pom tseeb cov no yuav tsis dhau los ua koj lub tis tiag tiag, tab sis ua ntej koj ua tis koj yuav tsum paub tseeb tias lub cav ua haujlwm zoo li koj xav tau thiab tuaj yeem ua haujlwm hnyav.
Nco ntsoov tias daim duab los lossis lub hnab ntawv loj txaus rau koj lub tis. Koj tuaj yeem siv nws ua "stencil" txhawm rau taug qab cov contour ntawm cov tis tiag hauv ntu 2 (rau cov txheej txheem yooj yim dua thiab huv dua), yog li qhov loj ntawm tus qauv thiab qhov tiag yuav tsum yog 1: 1 piv. Tsis tas li, nco ntsoov, thaum koj tab tom tsim tis, hwm kev cai lij choj. Tsis txhob theej cov tis koj pom uas tau kos lossis tsim los ntawm lwm tus. Koj tuaj yeem sib xyaw thiab sib phim cov qauv tsim no los tsim koj tus kheej, lossis yooj yim hais txog qhov xwm txheej, tab sis teeb meem kev cai lij choj tsis tsim nyog nws.
Yog tias koj siv daim duab los qhia, muab cov khoom tso rau hauv pem teb, thiab kos tawm ib qho ntawm koj lub tis duab hauv xaum. Xyuas kom tseeb tias qhov loj me yog qhov zoo ua ntej siv rab riam ntse los yog tuab tuab tuab tuab los yog tus cim, thiab taug qab cov kab sab hauv thiab sab hauv ntawm tis. Txiav cov duab los qhia tis tawm, tab sis tsuas yog nyob ib ncig ntawm tus qauv. Ntawm lwm qhov ib nrab ntawm daim duab los, tso lub tis tshiab uas tau txiav thiab taug raws sab nraud los tsim koj lub tis thib ob.
Yog tias koj siv hnab ntawv, txiav lawv kom lawv qhib tag. Ua raws tib cov kauj ruam ib yam li ntawm daim tawv ntoo tis, tab sis tom qab txiav ob qho tib si, nteg lawv rau hauv cov lus qhia rov qab (zoo li yog lawv tau hnav), thiab siv koj daim kab xev thiab popsicle sticks, kaw cov pas rau tis tib txoj kev uas koj xav tau ib txoj kab hlau hlau. Koj tseem tuaj yeem siv cov kua nplaum kub rau qhov no yog tias koj xav tias daim kab xev yuav tsis muaj zog txaus.
Kuv tau siv cov duab los qhia rau txoj haujlwm no, tab sis kuv tau muab daim duab ntawm daim ntawv tis uas tau ua nrog lub hnab ntim khoom noj ntawv, daim kab xev, thiab cov tshuaj ntxhua khaub ncaws, txawm hais tias nws tau ploj mus lawm yog li kuv tsis pom zoo siv cov tshuaj ntxhua khaub ncaws. Tej zaum koj yuav xav tau ntxiv lub hnab lossis duab los qhia nrog qee cov txheej txheej ntxiv, tab sis ceev faj qhov twg koj tso qhov hnyav lossis tis yuav hnyav heev rau qhov tsis raug.
Kauj Ruam 6: Txuas Tis rau Cov Tsav Tsheb
Muab koj lub cav servo tso rau ntawm ntug ntawm lub rooj lossis lub rooj uas muaj chaw txaus nyob rau hauv ob qho tib si, thiab ruaj ntseg lawv. Kuv siv cov kab xev kaw ntawm ntug ntawm lub chaw pw thiab qee qhov kev pab los ntawm kuv tus nus, tab sis koj tuaj yeem siv txhua yam ua haujlwm rau koj.
Txuas cov tis rau servos. Nco ntsoov tias koj nco qab yog tias cov servos nyob hauv "nqis" lossis "nce" txoj haujlwm thaum lawv raug tua, thiab txuas cov tis kom haum. Kuv siv qhov sib xyaw ntawm cov kab xev thiab cov koob hnyav.
Txuas koj li CPX rau lub zog xav tau, thiab sim tis tawm. Yog tias txhua yam mus tau zoo, thaum koj qaij CPX nce mus, cov tis yuav tsum ua raws, thiab qhov sib txawv rau nqes. Kuaj nws li ob peb feeb, ua qhov kev hloov kho uas koj xav tau.
Nco ntsoov tias cov no yog cov qauv tis thiab tej zaum yuav hnyav dua lossis hnyav dua li qhov haujlwm kawg, thiab siv lawv ua cov lus qhia rau kev ua yuam kev. Piv txwv li, ntawm kuv lub tis sab xis, kuv ntxiv qhov hnyav ntau dhau rau nruab nrab ntawm tis ntau dua li qhov kawg, yog li nws rub ntawm lub cav thiab ua rau nws muaj zog me ntsis ntau dua li tau npaj tseg. Nco tseg qhov ua yuam kev no yog li koj tuaj yeem kho lawv, xws li ua kom tis sib dua thiab tsom mus rau qhov hnyav qhov twg tis tau raws li qhov kev pabcuam.
Kauj Ruam 7: Hloov Kho zaum kawg
Ua ib qho kev hloov pauv rau cov hlua lossis coding koj xav tau lossis xav tau tam sim no. Thaum koj zoo siab nrog qhov kev pabcuam zoo li cas rau kev txav ntawm CPX, koj tuaj yeem txav mus rau ntu ob ntawm txoj haujlwm no, uas yuav npog qhov kev hloov pauv ntawm txoj haujlwm no mus rau ob peb lub tis uas txuas tau, txuas ntawm no!
Pom zoo:
Tsab ntawv tsa suab qhib lub teeb hloov: 3 kauj ruam
Motion Activated Lamp Switch: Thaum twg los peb tawm ntawm peb lub rooj lossis chav, feem ntau peb tsis hnov qab tua lub teeb nyob ntawd. Qhov no ua rau poob hluav taws xob thiab nce hauv koj daim nqi hluav taws xob. Tab sis dab tsi, yog tias lub teeb tau tig mus txiav, tom qab koj tawm hauv chav. Yog hauv
Los ntawm lub teeb nyem mus rau Tsab ntawv tsa suab Sensor nrog ESP8266 thiab MQTT: 5 Cov Kauj Ruam (nrog Duab)
Los ntawm Lub Teeb Nyeem rau Tsab Ntawv Pom Zoo Nrog ESP8266 thiab MQTT: Hauv kab ntawv no, kuv yuav nthuav qhia cov khoom hauv qab no: LEDs xav tau qhov txwv tam sim no circuithow kom ua lub teeb nyem ua lub teeb pom kev los ntawm lub roj teeb nqa tau, thiab dimming LEDs los ntawm ESP8266 ntawm MQTT thiab piav qhia luv luv txog yuav ua li cas th
Tsab ntawv tsa suab qhib lub teeb hloov nrog lub teeb Sensor: 5 Kauj Ruam
Tsab ntawv tsa suab qhib lub teeb hloov nrog lub teeb pom kev zoo: Lub suab qhib lub teeb hloov muaj ntau daim ntawv thov hauv tsev thiab hauv chaw ua haujlwm. Qhov no, txawm li cas los xij, tau ntxiv qhov zoo ntawm kev suav nrog lub teeb pom kev zoo, yog li ntawd, lub teeb no tsuas tuaj yeem ua rau thaum tsaus ntuj
Tsab ntawv tsa suab Sensor qhib LED Sawb Nrog Timer: 6 Cov Kauj Ruam (nrog Duab)
Tsab ntawv tsa suab Sensor qhib LED Sawb Nrog Timer: Nyob zoo txhua tus! Kuv zoo siab heev tau sau lwm cov ntawv qhia tam sim no. Qhov haujlwm no tau los thaum kuv raug hu los ntawm ib tus neeg qhia qhia-er (?!) (David @dducic) ob peb lub hlis dhau los thov kom qee qhov kev pab tsim. Yog li ntawm no yog qhov tseem ceeb tshwj xeeb: & q
Tsab ntawv tsa suab qhib Security Security Yard Kos Npe: 4 Cov Kauj Ruam (nrog Duab)
Motion Activated Security Yard Sign: Tsoos kev nyab xeeb kev nyab xeeb hauv tsev cov cim tsis ua dab tsi. Qhov tseeb lawv tsis tau hloov pauv ntau dua 30 xyoo dhau los. Txawm li cas los xij, lawv yog qhov muaj txiaj ntsig tiv thaiv tsuav lawv tso rau hauv qhov chaw pom tau zoo hauv koj lub vaj thiab saib zoo. Kuv hlub