Cov txheej txheem:

MicroBit Chav Nyob Tus Kheej thiab Tus Tswj: 4 Kauj Ruam
MicroBit Chav Nyob Tus Kheej thiab Tus Tswj: 4 Kauj Ruam

Video: MicroBit Chav Nyob Tus Kheej thiab Tus Tswj: 4 Kauj Ruam

Video: MicroBit Chav Nyob Tus Kheej thiab Tus Tswj: 4 Kauj Ruam
Video: [2019] Big Things: Living Apps by Chema Alonso [Eng] 2024, Kaum ib hlis
Anonim
MicroBit Chav Nyob Hauv Lub Tuam Txhab thiab Tus Tswj
MicroBit Chav Nyob Hauv Lub Tuam Txhab thiab Tus Tswj

Thaum muaj kev kis thoob qhov txhia chaw, ib txoj hauv kev los txo kev kis tus kabmob yog ua kom lub cev nyob deb ntawm tib neeg.

Hauv chav lossis khw muag khoom, nws yuav pab tau kom paub tias muaj pes tsawg tus neeg nyob hauv qhov chaw nyob nrog txhua lub sijhawm.

Txoj haujlwm no siv ob lub cim ntsuas kom pom cov neeg nkag thiab tawm hauv chav. Lub Circuit Court tuaj yeem teeb tsa ntawm lub qhov rooj kom cov neeg hla nws thaum lawv tawm mus thiab nkag mus.

Nws ua haujlwm los ntawm kev muaj ob Lub Teeb Pom Kev Tiv Thaiv (LDR) teeb tsa kom pom tus neeg hla lub cuab yeej. Raws li qib ntawm lub teeb poob ntawm LDR nce, qhov ntws tam sim no los ntawm tus tiv thaiv nce. Qhov no tuaj yeem ntsuas los ntawm microBit.

Ib tus neeg tawm hauv chav yuav hla 'sab hauv' LDR ua ntej thiab qhov ntawd yuav raug kuaj pom los ntawm microBit. Yog tias muaj ntau dua ib tus neeg nyob hauv chav, nws yuav rho tawm ib tus los ntawm tus neeg nyob hauv.

Ib tus neeg nkag mus hauv chav yuav hla qhov 'sab nrauv' LDR ua ntej thiab qhov ntawd yuav kuaj pom los ntawm microBit. Yog tias muaj tsawg dua li cov neeg tau tso cai ntau tshaj plaws hauv chav, nws yuav ntxiv 1 rau tus suav nrog. Yog tias lub ntsuas hluav taws xob sab nrauv dhau mus, thiab twb muaj cov neeg tso cai ntau kawg hauv chav lawm, yuav tsum 'kos npe tso tseg' thiab cov lus ceeb toom yuav ua si.

Tsis teb los tau Command Center

Muaj qhov thib ob microBit uas yog lub chaw hais kom ua. Nws yuav nyob ntawm tus neeg khaws nyiaj lossis tus kws qhia ntawv qhov chaw nyob. Txhua lub sijhawm ib tus neeg nkag los lossis tawm hauv chav, suav hauv chav raug xa tawm mus rau lub chaw hais kom ua microBit. Yog tias qhov siab tshaj nyob hauv, qhov chaw hais kom ua microBit kuj tseem nrov thiab qhia lub cim ceeb toom.

Tus neeg siv kuj tseem tuaj yeem nce lossis txo qhov nyob siab tshaj plaws los ntawm kev siv A thiab B cov nyees khawm kom hloov pauv tus nqi ntau tshaj. Los ntawm nias khawm A thiab khawm B ua ke, tus nqi siab tshaj plaws tshiab tau xa mus rau lub xov tooj ntawm tes microBit qhov chaw siab tshaj tus nqi nyob hauv tau hloov kho.

Cia peb tsim txoj haujlwm no!

Khoom siv:

Tus Neeg Nyob Hauv Chav

  • BBC microBit
  • Cov qhob cij
  • Lub Teeb Ntsuas Tus Kheej (2)
  • 1K Ohm resistor (2)
  • Piezo Buzzer Cov
  • Txuas xov hlau
  • Caj dab clip thaj thaj (5)

Command Center (yeem)

  • BBC microBit
  • Piezo buzzer
  • Caj dab clip thaj thaj (2)

Kauj Ruam 1: Tsim Lub Tsev Counter Circuit

Txhim Kho Chav Tsev Counter Circuit
Txhim Kho Chav Tsev Counter Circuit
Txhim Kho Chav Tsev Counter Circuit
Txhim Kho Chav Tsev Counter Circuit

Txhim kho lub Circuit Court raws li qhia hauv daim duab. Koj tuaj yeem siv tus nab kuab clip thaj txuas los koom nrog cov xov hluav taws xob tso tawm, GND thiab 3V xov hlau rau tus pin ntawm microBit.

Xyuas kom koj muaj qhov sib txawv ntawm piezo buzzer taw qhia kom raug. Yog tias muaj tus lej luv, nws mus rau GND thiab tus pin ntev dua mus rau Pin 0 ntawm microBit. Yog tias lawv nyob tib qhov ntev, kev taw qhia tsis txawv.

Ob zaug-xyuas koj cov thaiv thiab tom qab ntawd cia peb tau txais cov lej!

Kauj Ruam 2: Ntsuam Xyuas Koj Li Circuit Court

Kuaj Koj Li Circuit Court
Kuaj Koj Li Circuit Court

Ua ntej koj siv sijhawm ua txhua qhov coding rau lub txee, siv sijhawm li ob peb feeb los nkag rau qhov LDR Calibration sketch lossis upload cov duab kos.hex ntawv txuas rau koj microBit.

Thaum khiav, daim duab yuav qhia koj me ntsis pob zeb diamond ntawm cov zaub thaum nws pom koj txhais tes npog lub teeb nyob ntawm tus tiv thaiv. Kuaj ob qho tib si analog pins 1 thiab 2 ua ntej mus rau kauj ruam tom ntej.

Kauj Ruam 3: Coding Tus Neeg Nyob Hauv Chav

Coding Tus Neeg Nyob Hauv Chav
Coding Tus Neeg Nyob Hauv Chav

Nkag mus rau cov lej thaiv ntawm daim duab lossis xa cov ntawv.hex rau koj microBit.

Qhov sib txawv maxOccupancy tuaj yeem hloov kho kom haum rau qhov txwv nyob hauv chav.

Qhov sib txawv ntawm qib sib txawv yog qhov txo qis qib qib uas yuav tsum tau ua ntej ua ntej microBit yuav suav ib tus neeg li nkag/tawm hauv chav. Tej zaum koj yuav tsum tau kho tus nqi no raws qhov pom kev ib puag ncig hauv koj chav.

Thaum rub tawm, sim hla koj txhais tes hla lub 'sab nrauv' lub teeb nyob ntawm tus tiv thaiv. Chav suav yuav tsum nce ntxiv.

Raws li koj khaws 'nkag mus' hauv chav, thaum kawg koj yuav dhau qhov maxOccupancy tus nqi thiab qhov 'nres kos npe' yuav tshwm ntawm LED zaub thiab lub suab luv yuav ua suab nrov. Tsis muaj neeg ntxiv mus rau hauv chav.

Dhau koj txhais tes hla 'sab hauv' lub teeb nyob ntawm tus tiv thaiv thiab suav chav yuav tsum pib qis zuj zus txhua lub sijhawm koj npog lub teeb nyob ntawm tus tiv thaiv.

Okay! Koj tau txais chav ua haujlwm nyob hauv txee!

Koj puas xav ua kom nws zoo dua? Nyeem rau!

Kauj Ruam 4: Tsim Lub Chaw Hais Plaub thiab Code Nws

Tsim lub Command Center thiab Code It
Tsim lub Command Center thiab Code It

Txuas lub microBit thib ob raws li hauv qab no.

Siv tus nab kuab clip thaj qaum, txuas sab luv ntawm ob lub piezo buzzer mus rau GND tus pin ntawm microBit.

Txuas sab ntev ntawm lub suab nrov mus rau Pin 0 ntawm microBit siv lwm thaj txuas. Ib zaug ntxiv, yog tias cov pins yog qhov ntev tib yam, kev taw qhia tsis muaj teeb meem.

Cov txheej txheem txheej txheem siv xov tooj cua nta ntawm microBit.

Nkag mus rau cov lej thaiv raws li daim duab lossis xa cov ntaub ntawv.hex uas tau muab rau microBit.

Txhua lub sijhawm chav nyob suav nrog microBit pom qhov nkag los lossis tawm, nws xa cov chav tam sim no suav mus rau lub chaw saib xyuas. Yog tias qhov txwv tsis pub muaj neeg nyob ntau tshaj nws xa tus '99' uas lub chaw saib xyuas pom tau pom thiab tom qab ntawd qhia qhov 'nres kos npe' thiab ua suab nrov ceeb toom.

Tus neeg siv tuaj yeem nce qhov txwv tsis pub muaj neeg nyob ntau tshaj los ntawm nias khawm B ntawm microBit.

Tus neeg siv yuav txo qis qhov nyob hauv siab tshaj plaws los ntawm nias khawm A ntawm microBit.

Nias khawm A thiab khawm B ua ke yuav xa tus nqi siab tshaj nyob rau hauv chav nyob hauv chav microBit. Koj yuav pom 'u' ntawm lwm microBit cov zaub los qhia tias tus nqi tau hloov kho tshiab. Tam sim no lub txee nyob hauv chav yuav ua haujlwm raws tus nqi tshiab.

Kuv vam tias koj pom qhov Kev Qhia Ua Kev lom zem thiab qhia paub!

Tam sim no mus ua ib yam dab tsi WONDERFUL !!

Pom zoo: