Cov txheej txheem:
- Kauj Ruam 1: Lub Hom Phiaj
- Kauj ruam 2: Cov ntaub ntawv
- Kauj Ruam 3: Ua Ntej Ua Ntej: Txuas Koj Li Micro: Bit
- Kauj Ruam 4: Kauj Ruam 0: Code Flow
- Kauj Ruam 5: Kauj Ruam 1: Txheeb cais Variables
- Kauj Ruam 6: Kauj Ruam 2: Hloov Tilt Qhov Muaj nqis rau Qib
- Kauj Ruam 7: Kauj Ruam 3: Sau Qib Qaij
- Kauj Ruam 8: Kauj Ruam 4: Sau LEDPlotList Cov Haujlwm
- Kauj Ruam 9: Kauj Ruam 5: Plot LED Matrix rau Txhua Qhov Case
- Kauj Ruam 10: Kauj Ruam 6: Sau Calibration Functions
- Kauj Ruam 11: Kauj Ruam 7: Sau Lub Xeem Ua Haujlwm
- Kauj Ruam 12: Kauj Ruam 8: Muab Nws Ua Ke Ib Sab 1
- Kauj Ruam 13: Kauj Ruam 9: Muab Txhua Qhov Ua Ke Ntu 2
- Kauj Ruam 14: Kauj Ruam 10: Sib dhos
- Kauj ruam 15: Qhov chaw
Video: Tsim Kev Ntsuas Hluav Taws Xob: 15 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:29
Siv qib siab no kom nrawm thiab yooj yim tso saib qhov qaij ntawm txhua yam khoom txuas!
Tsim los ntawm Kaitlyn los ntawm Raffles Institution.
Kauj Ruam 1: Lub Hom Phiaj
Kawm nyeem qaij nrog micro: ntsis tus ua-hauv kev ntsuas lub ntsuas.
Kawm ua haujlwm nrog micro: me ntsis 5x5 LED Zaub!
Kauj ruam 2: Cov ntaub ntawv
1 x BBC micro: me ntsis
1 x Micro USB cable
2 x AA Roj teeb
1 x Ob Chav AA Roj Teeb Pob
Kauj Ruam 3: Ua Ntej Ua Ntej: Txuas Koj Li Micro: Bit
- Txuas BBC micro: me ntsis rau koj lub computer siv lub micro USB cable.
- Nkag mus rau javascript editor rau micro: ntsis ntawm makecode.microbit.org.
Kauj Ruam 4: Kauj Ruam 0: Code Flow
Ua ntej peb pib sau cov cai, peb yuav tsum txiav txim siab yam peb xav ua kom tiav nrog txoj haujlwm thiab nyob hauv qhov kev txiav txim twg yuav tsum txhua qhov kev ua haujlwm.
Txog qib hluav taws xob, qib uas peb yuav ua hauv txoj cai rau txhua lub voj yog:
- Nyeem nyeem qaij los ntawm lub ntsuas cua.
- Hloov qaij nyeem ntawv kom qaij theem kom pom ntawm LED matrix.
- Txheeb rau kev hloov pauv qib qaij nyeem los ntawm lub voj dhau los.
- Tsim cov kab ke ntawm LED sib txawv rau cov teeb meem qaij sib txawv thiab cov lus qhia.
- Lub phiaj xwm LED tswj mus rau micro: me ntsis LED matrix.
Ob peb lub luag haujlwm ntxiv uas peb xav tau suav nrog yog:
- Calibration rau thawj txoj haujlwm qaij.
- Rov qab mus rau qhov qub qaij calibration.
Kauj Ruam 5: Kauj Ruam 1: Txheeb cais Variables
Peb pib los ntawm kev txhais cov ntsiab lus xav tau raws li qhia. Kev tawg ntawm qee qhov kev hloov pauv yog:
- tiltList: Array uas khaws cov qaij los ntawm qhov muaj nqis 0-4 hauv qhov kev txiav txim [Sab laug, Txoj Cai, Mus Ntxiv, Rov Qab]
- TiltBoundary: Ciam teb ntawm thawj qib qaij ntawm 0 (tsis qaij) thiab 1 (qaij me ntsis)
- prevState: Array uas khaws cov qaij qhov tseem ceeb ntawm micro: me ntsis los ntawm lub voj yav dhau los hauv tib hom ntawv raws li tiltList, siv los tshuaj xyuas qhov hloov pauv ntawm qaij nruab nrab ntawm iterations
- ledPlotList: Lub ntsiab lus coj cov kab ke ua ke hauv daim ntawv (x, y). Txhawm rau txheeb xyuas qhov array, peb siv tus lej naj npawb los qhia txog cov kab zauv ntawm cov sib txawv ntawm hom: tus lej.
Kauj Ruam 6: Kauj Ruam 2: Hloov Tilt Qhov Muaj nqis rau Qib
Raws li 5x5 LED matrix tuaj yeem tsuas yog qhia ntau cov ntaub ntawv, qhov tseeb qaij qhov tseem ceeb yuav tsis muaj txiaj ntsig rau zaub.
Hloov chaw, ua haujlwm tiltExtent () siv tus lej ntsuas, uas hais txog tus nqi qaij los ntawm lub ntsuas cua, thiab hloov cov qaij qhov tseem ceeb (tus lej) mus rau qib qaij ntawm 0 txog 4.
0 qhia tias tsis muaj qaij nyob rau hauv cov lus qhia thiab 4 qhia tias qaij loj heev, thaum -1 rov qab thaum muaj qhov yuam kev.
Ntawm no, tiltBoundary thiab tiltSensitivity tau siv los ua ciam teb qhov tseem ceeb ntawm qib qaij.
Kauj Ruam 7: Kauj Ruam 3: Sau Qib Qaij
Ob txoj haujlwm checkRoll () thiab checkPitch () sau qib qaij uas tau txais los ntawm tiltExtent () rau hauv tiltList rau yob (sab laug-sab xis) thiab lub suab (rau pem hauv ntej-rov qab) axes feem.
Ua ntej siv qhov qaij qhov tseem ceeb, peb ntsuas lawv siv tus lej xoom rau ob lub suab (zeroPitch) thiab yob (zeroRoll) tau los ntawm kev ntsuas ntsuas ua haujlwm tom qab.
Raws li kev ntsuas tus ntsuas qhov ntsuas tsis zoo rau ob sab laug thiab tom ntej qaij, peb yuav tsum siv Math.abs () ua haujlwm kom tau txais cov qauv ntawm tus nqi tsis zoo uas tau muab rau tiltExtent () ua haujlwm raws li qhov ntsuas rau ob qho lus qhia no.
Kauj Ruam 8: Kauj Ruam 4: Sau LEDPlotList Cov Haujlwm
Thaum tau txais qib qaij hauv tiltList peb tam sim no tuaj yeem sau cov phiaj xwm coj coj mus rau qhov xwm txheej sib txawv uas tuaj yeem tshwm sim, uas yog
- plotSingle (): Qaij nkaus xwb nyob rau hauv ib qho kev taw qhia, noj raws li qaij nyob rau hauv cov lus qhia raws li qhov ntsuas.
- plotDiagonal (): Qaij hauv ob qho lus qhia ntawm tib qhov loj, siv qhov qaij ntawm ob qho tib si raws li qhov ntsuas.
- plotUnequal (): Qaij hauv ob qho kev qhia ntawm qhov sib txawv sib txawv, ntsuas qhov qaij ntawm txhua qhov kev qhia ua qhov ntsuas. Siv plotDiagonal () ua ntej thiab ntxiv rau ledPlotList array tom qab.
Cov phiaj xwm kev ua haujlwm no sau cov kab ke coj mus rau ledPlotList kom tau npaj ua ntej tom qab.
Kauj Ruam 9: Kauj Ruam 5: Plot LED Matrix rau Txhua Qhov Case
Siv cov phiaj xwm phiaj xwm los ntawm peb qhov xwm txheej hauv qib 4, tam sim no peb tuaj yeem npaj qhov tseeb LED matrix rau qhov sib txawv ua ke ntawm qib qaij. Raws li peb lub luag haujlwm hauv qib 4 tsis cais cais kev taw qhia, peb yuav tsum hloov kho qhov kev sib koom tes tau dhau mus rau LED matrix los npaj cov LEDs hauv txoj kev yog.
PlotResult () muaj ntau yam yog tias muaj xwm txheej uas txheeb xyuas hom qaij thiab npaj lub teeb ci LED raws li siv led.plot (x, y). Qhov ua tau ua ke ntawm qaij yog:
Ib qho kev qhia: Sab laug Tsuas Yog Txoj Cai Xwb
Ib qho kev taw qhia: Forward Only or Backward Only
Ob txoj kev qhia: Forward-left or Backward-left
Ob txoj kev qhia: Forward-right or Backward-right
Nco tseg: Rau qaij hauv ob qho lus qhia, txhua qhov sib xyaw ua ke tuaj yeem muaj qhov zoo ib yam lossis sib txawv (txheeb xyuas los ntawm kev sib piv maxX thiab maxY), thiab yog li siv cov phiaj plotDiagonal () lossis cov phiaj sib npaug () feem.
Kauj Ruam 10: Kauj Ruam 6: Sau Calibration Functions
Tom qab ua tiav qhov ntau ntawm cov cai, peb tam sim no ntxiv rau hauv calibTilt () thiab resetTilt () ua haujlwm.
calibTilt () tso cai rau cov neeg siv los ntsuas qhov qaij mus rau xoom ntawm micro: ntsis txoj haujlwm tam sim no
resetTilt () rov pib kho qhov ntsuas ntawm lub rooj tsavxwm rau nws lub xeev qub.
Kauj Ruam 11: Kauj Ruam 7: Sau Lub Xeem Ua Haujlwm
Peb ntxiv txoj haujlwm yooj yim checkState () los xyuas seb qib qaij tau hloov pauv los ntawm kev rov ua dua yav dhau los.
Yog tias tsis muaj kev hloov pauv hauv qib qaij los ntawm kev rov ua dua yav dhau los piv txwv li lub xeev hloov == 0, peb tuaj yeem ncaj qha mus rau qhov rov ua dua thiab hla cov phiaj xwm ntawm LED matrix, txo kev suav xav tau.
Kauj Ruam 12: Kauj Ruam 8: Muab Nws Ua Ke Ib Sab 1
Tam sim no peb tuaj yeem thaum kawg tso tag nrho cov haujlwm tsim nyog rau hauv micro: ntsis lub voj tsis muaj qhov kawg los ua nws ntau zaus.
Ua ntej tshaj plaws, peb teeb tsa A thiab B ntawm micro: me ntsis rau calibTilt () thiab rov pib dua () ua haujlwm raws li siv cov tswv yim.onButtonPressed (), thiab npaj cov zuam ntawm LED matrix thaum ntsuas ntsuas tiav.
Kauj Ruam 13: Kauj Ruam 9: Muab Txhua Qhov Ua Ke Ntu 2
Tom ntej no khiav cov haujlwm tsim nyog raws li peb cov cai ntws hauv Kauj Ruam 0 thiab txheeb xyuas qhov kev hloov pauv hauv lub xeev (lub ntsiab lus tias muaj kev hloov pauv hauv qaij ntawm micro: me ntsis txij li qhov rov ua dua zaum kawg).
Yog tias muaj kev hloov pauv hauv qib qaij piv txwv li stateChange == 1, cov cai yuav hloov pauv ua ntej mus rau qib qaij tshiab thiab teeb tsa stateChange rov qab rau 0 rau qhov rov ua dua tom ntej, thiab npaj cov qib qaij tshiab ntawm LED matrix siv PlotResult ().
Kauj Ruam 14: Kauj Ruam 10: Sib dhos
Nyem qhov ua tiav txoj cai rau koj micro: me ntsis.
Txuas koj lub micro: me ntsis thiab lub roj teeb pob ruaj ntseg rau txhua yam khoom thiab nws tau npaj rau siv!
Zoo heev
Muaj kev lom zem nrog koj qib hluav taws xob! Thiab thaum koj nyob ntawm nws, vim li cas ho tsis sim nthuav lub peev xwm ntawm lub qaij sensor lossis txawm tig nws mus ua si?
Kab lus no yog los ntawm TINKERCADEMY.
Kauj ruam 15: Qhov chaw
Kab lus no yog los ntawm:
Yog tias koj muaj lus nug, koj tuaj yeem tiv toj : [email protected].
Pom zoo:
Cov Hluav Taws Xob Hluav Taws Xob Hluav Taws Xob DIY Powered Nrog 1.25 V thiab 0.054 Ma: 4 Kauj Ruam
Lub Tshuab Hluav Taws Xob Hluav Taws Xob DIY Tsim Nrog 1.25 V thiab 0.054 Ma: Lub hom phiaj: ua kom lub tshuab hluav taws xob Dc me me siv nrog ib lub hnub ci vaj huam sib luag me me vimun sc-3012-2a (siv sab hauv thiab sab nraum zoov) 29.44mm × 11.6mm × 1.1mm, uas tuaj yeem ua tau ua qhov ci ci uas muab tsuas yog 1,25 VX 0.054 maFind peb ON INSTAGRAM thiab pom qhov yooj yim elec
Cov Hluav Taws Xob Hluav Taws Xob Hluav Taws Xob Hluav Taws Xob Igniter: 6 Kauj Ruam (nrog Duab)
Cov Hluav Taws Xob Bluetooth Hluav Taws Xob Igniter: Puas yog nws zoo rau taws ntau dua ib lub foob pob hluav taws tib lub sijhawm? Lossis txawm tias muaj kev nyab xeeb nyob deb rau qhov phom sij txaus ntshai. Hauv qhov haujlwm no kuv yuav qhia koj yuav tsim lub Circuit Court uas tuaj yeem ua tau li cas nrog kev pab ntawm Bluetooth ua haujlwm
Yuav Ua Li Cas Tswj DC Gear Motor los ntawm Kev Siv 160A Txhuam Cov Hluav Taws Xob Hluav Taws Xob Hluav Taws Xob thiab Servo Tester: 3 Cov Kauj Ruam
Yuav Ua Li Cas Tswj DC Gear Motor los ntawm Kev Siv 160A Txhuam Cov Hluav Taws Xob Hluav Taws Xob thiab Cov Kev Pabcuam Servo: Kev Qhia Tshwj Xeeb: Voltage: 2-3S Lipo lossis 6-9 NiMH Nruam tam sim no: 35A Tam sim no tawg: 160A BEC: 5V / 1A, tawm qauv: 1. pem hauv ntej & thim rov qab; 2. mus &nres; 3. rau pem hauv ntej & nres & thim rov qab: 34g Loj: 42*28*17mm
Ib Leeg Hluav Taws Xob Hluav Taws Xob / Hluav Taws Xob Hluav Taws Xob: 6 Cov Kauj Ruam
Ib Leeg Hluav Taws Xob Hluav Taws Xob Hluav Taws Xob / Hluav Taws Xob Hluav Taws Xob: Hauv qhov haujlwm no peb tab tom ua kom muaj Ib lub kauj induction lub cev Muaj zog, thiab ntau yam piav qhia ntxiv, cov qauv ntawm lub tshuab hluav taws xob no tau siv ntau yam khoom siv tam sim no. Peb lub cav tsis muaj lub zog loj, nws yog ntau ntxiv txog kev ua haujlwm
Yuav Ua Li Cas Siv Cov Hluav Taws Xob Hluav Taws Xob Hluav Taws Xob Hluav Taws Xob Module: 6 Kauj Ruam
Yuav Ua Li Cas Siv Cov Hluav Taws Xob Hluav Taws Xob Hluav Taws Xob Hluav Taws Xob Module: Nco tseg thiab ceev faj: CFL muaj cov mercury uas yog cov khoom phom sij, yog li nws yuav tsum tau ua raws li feem ntau CFL cov teeb, hluav taws xob hluav taws xob tau ua haujlwm zoo thiab tseem siv tau, tsuas yog lub teeb mus tsis zoo. CFL Circuit Court ntawm 18-24 Watts yog