Cov txheej txheem:
- Kauj ruam 1: Txuas Koj Micro: ntsis rau lub khoos phis tawj
- Kauj ruam 2: Mus rau Micro: ntsis Python Editor
- Kauj Ruam 3: Tshaj Tawm Txoj Cai rau Koj Micro: ntsis
- Kauj ruam 4: Ua si
Video: Micro: ntsis Memory Game: 4 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
Kev ua si nco yooj yim, qhov uas koj yuav tsum nco qab ib ntu thiab teb yog tias zaum thib ob nyob ib puag ncig, qhov ua ntu zus yog qhov zoo ib yam. Txhua qhov puag ncig ib kauj ruam ntxiv tau ntxiv rau qhov ua ntu zus.
Kauj ruam 1: Txuas Koj Micro: ntsis rau lub khoos phis tawj
Tsuas muaj ob yam peb xav tau txhawm rau ua qhov kev ua si nco no:
ib: micr
ib lub computer rau coding
Yog tias koj tsis muaj micro: me ntsis tsis tau, tau txais ib qho! Lawv yog qhov tsis txaus ntseeg lom zem me ntsis los ua haujlwm nrog, thiab txoj hauv kev yooj yim rau cov menyuam nrhiav pom thev naus laus zis thiab kev ua haujlwm.
Txhawm rau ua kom peb lub teeb ci, koj yuav tsum txuas koj lub micro: ntsis rau lub khoos phis tawj ntawm usb-cable.
Kauj ruam 2: Mus rau Micro: ntsis Python Editor
Txhawm rau tsim qhov kev ua si, peb yuav tsum tau tso qee cov lej ntawm peb cov micro me. Txhawm rau ua qhov no, mus rau:
Xaiv cov cai yooj yim uas tau muab, thiab muab cov lej hauv qab no rau tus kho:
# Ntxiv koj tus lej nab npawb ntawm no. Egfrom microbit ntshuam * ntshuam random # tsim cov lus qhia ua = ["A", "B", Image. ARROW_N, Image. ARROW_E, Image. ARROW_S, Image. ARROW_W] # kev ua si dav dav txav = gameover = Cuav def show_moves (): display.show (txav, ncua = 1000) pw (1000) display.show ('=') pw (1000) xaiv = (random.randint (1, 2)) yog xaiv == 2: display.show (txav, ncua = 1000) pw (1000) elif xaiv == 1: ntev = len (txav) -1 newMoves = daim ntawv (txav) newnr = (random.randint (0, ntev)) oldmove = newMoves [newnr] newmove = random.choice (ua) newMoves [newnr] = newmove yog oldmove == newmove: xaiv = 2 display.show (newMoves, ncua = 1000) pw (1000) buttonpressed = Tsis tseeb thaum khawm == Tsis tseeb: display.show (' ? ') yog xaiv == 2: yog button_b.was_pressed (): rov True buttonpressed = True break elif button_a.was_pressed (): display.show (Image. HAPPY) pw tsaug zog (2000) buttonpressed = True return False elif xaiv == 1: yog tias button_a.was_pressed (): rov True buttonpressed = True break elif button_b. was_pressed (): display.show (Image. HAPPY) pw tsaug zog (2000) buttonpressed = True return False def ntxiv_nextMove (): moves.append (random.choice (actions)) # game thaum gameover == Tsis tseeb: add_nextMove () gameover = show_moves () display.scroll ("Missed..") display.show (Image. SAD) pw tsaug zog (2000)
Kauj Ruam 3: Tshaj Tawm Txoj Cai rau Koj Micro: ntsis
Ua ntej tshaj plaws, nco ntsoov tias koj lub microbit txuas nrog koj lub khoos phis tawj.
Hauv tus kws kho ntawv, nyem Rub tawm hauv lub kaum sab saud sab saud, txhawm rau rub tus lej rau koj lub khoos phis tawj, thiab rub thiab tso cov ntawv hauv cov ntawv tshawb fawb rau koj lub microbit.
Lub teeb txiv kab ntxwv nyob tom qab ntawm koj lub micro: me ntsis yuav pib ntsais muag. Sai li qhov hloov pauv tau ua tiav, txoj cai yuav pib ua haujlwm thiab thawj theem ntawm qhov kev ua si yuav pib!
Kauj ruam 4: Ua si
Txhawm rau rov pib ua si, nias lub pob tom ntej ntawm usb-chaw nres nkoj ntawm koj micro: ntsis, uas ua raws li khawm rov pib dua.
Koj yuav pom ib lub cim, ua raws li '='-kos npe, cim thib ob thiab cim cim nug. Piv txwv li: A = A?
Qhov kev ua si yog qhov yooj yim: thawj ntu sib npaug qhov thib ob?
Koj puas xav tias nws ua? Nias A. Koj puas xav tias nws tsis ua? Xovxwm B.
Yog tias koj muaj hmoo, lub ntsej muag luag ntxhi yuav tshwm sim, thiab koj yuav mus rau lwm qhov ntxiv, ntxiv lub cim rau ntu.
Yog tias koj tsis muaj hmoo, lub ntsej muag tu siab yuav tshwm sim.
Tsuas yog sim dua los ntawm nias lub pob pib dua nyob tom qab!
Txaus siab rau!
Pom zoo:
Arduino Nano-MMA8452Q 3-Axis 12-ntsis/8-ntsis Digital Accelerometer Tutorial: 4 Kauj Ruam
Arduino Nano-MMA8452Q 3-Axis 12-ntsis/8-ntsis Digital Accelerometer Tutorial: MMA8452Q yog tus ntse, tsis muaj zog, peb-axis, muaj peev xwm, micromachined accelerometer nrog 12 qhov kev daws teeb meem. Cov neeg siv yooj yim programmable xaiv tau muab nrog kev pab ntawm kev ua haujlwm hauv lub ntsuas qhov ntsuas, teeb tsa tau rau ob qho kev cuam tshuam
Yuav Ua Li Cas Siv Servo Motors Siv Moto: ntsis Nrog Micro: ntsis: 7 Kauj Ruam (nrog Duab)
Yuav Ua Li Cas Siv Servo Motors Siv Moto: ntsis Nrog Micro: ntsis: Ib txoj hauv kev txuas ntxiv kev ua haujlwm ntawm micro: ntsis yog siv lub rooj tsav xwm hu ua moto: ntsis los ntawm SparkFun Electronics (kwv yees li $ 15-20). Nws zoo li nyuaj thiab muaj ntau yam ntxwv, tab sis nws tsis nyuaj rau kev ua haujlwm servo motors los ntawm nws. Moto: me ntsis tso cai rau koj
Raspberry Pi MMA8452Q 3-Axis 12-ntsis/8-ntsis Digital Accelerometer Python Qhia: 4 Kauj Ruam
Raspberry Pi MMA8452Q 3-Axis 12-ntsis/8-ntsis Digital Accelerometer Python Tutorial: MMA8452Q yog tus ntse, tsis muaj zog, peb-axis, muaj peev xwm, micromachined accelerometer nrog 12 qhov kev daws teeb meem. Cov neeg siv yooj yim programmable xaiv tau muab nrog kev pab ntawm kev ua haujlwm hauv lub ntsuas qhov ntsuas, teeb tsa tau rau ob qho kev cuam tshuam
Raspberry Pi MMA8452Q 3-Axis 12-ntsis/8-ntsis Digital Accelerometer Java Qhia: 4 Kauj Ruam
Raspberry Pi MMA8452Q 3-Axis 12-ntsis/8-ntsis Digital Accelerometer Java Tutorial: MMA8452Q yog tus ntse, tsis muaj zog, peb-axis, muaj peev xwm, micromachined accelerometer nrog 12 qhov kev daws teeb meem. Cov neeg siv yooj yim programmable xaiv tau muab nrog kev pab ntawm kev ua haujlwm hauv lub ntsuas qhov ntsuas, teeb tsa tau rau ob qho kev cuam tshuam
Kev ntsuas lub teeb thiab xim Nrog Pimoroni Enviro: ntsis rau Micro: ntsis: 5 Kauj Ruam
Kev ntsuas lub teeb thiab xim Nrog Pimoroni Enviro: me ntsis rau Micro: me ntsis: Kuv tau ua haujlwm ntawm qee lub cuab yeej uas tso cai ntsuas lub teeb thiab xim yav dhau los thiab koj yuav pom ntau txog qhov kev xav tom qab kev ntsuas ntsuas cov lus qhia ntawm no thiab ntawm no.Pimoroni muaj tsis ntev los no tso tawm enviro: me ntsis, ntxiv rau