Cov txheej txheem:
- Khoom siv
- Kauj Ruam 1: Teeb lub Breadboard Nrog 18 LEDs
- Kauj Ruam 2: Ntxiv 9 Nthuav Ib Sab ntawm LEDs
- Kauj Ruam 3: Txuas Cov Hlau Los Ntawm Breadboard mus rau Pi
- Kauj ruam 4: Upload Code
Video: TicTacToe Khoos Phis Tawj Siv RaspberryPi: 4 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
Txoj haujlwm no lub hom phiaj ntawm kev tsim qauv sib tham TicTacToe siv ob lub xim sib txawv LEDs qhia txog ob tus neeg siv siv raspberry pi. Lub tswv yim ntawm no yog txhawm rau ua qhov no ntawm qhov loj dua ntawm txoj kev taug - xav txog kab sib chaws ntawm 3x3 ib nrab ntiaj teb (zoo li cov uas tau hais los saum no) nyam ntawm phab ntsa uas nias ib qho pib qhov kev ua si (thiab cov xim tshwj xeeb LED tig rau). Qhov no tuaj yeem ua tiav hauv txoj kev ib sab ntawm cov tuav, pub noj lossis lwm qhov chaw uas tib neeg yuav tsum tau ua kab thiab tos - yog li ua rau thaj tsam yog thaj chaw sib tham uas tib neeg nyiam thaum lawv tos.
Khoom siv
Rau tus qauv - Kuv siv cov khoom muaj rau kuv:
- Raspberry Pi 3 Qauv B+ nrog raspbian teeb tsa ntawm SD daim npav
- Momentary Push Button - 9x
- LEDs - 9x Ntsuab, 9x Liab
- Cov qhob cij
- Cov xov hlau- Poj niam rau Poj niam, cov xov tooj tooj liab tsis tu ncua uas feem ntau tuaj nrog cov khoom siv dev- 22 guage insulated tooj liab hlau (zoo li qhov no (tsis muaj kev koom tes nrog tus muag khoom))- (https://www.amazon.com/Elenco-Hook-Up- Colors-dispenser-WK-106/dp/B008L3QJAS/ref = sr_1_1? Keywords = tooj liab+xov hlau+elenco & qid = 1568868843 & s = qhov rooj & sr = 8-1)
- 220 ohm resistors - 9x
Kauj Ruam 1: Teeb lub Breadboard Nrog 18 LEDs
Ua ntej, teeb tsa lub khob cij hauv kab sib chaws ntawm 3x3 nrog ob lub LED sib txawv ntawm ib sab raws li pom hauv daim duab saum toj no. Peb yuav tsav 18 LEDs siv tsuas yog 5 tus pin (hu ua tswj pins hauv qab) los ntawm raspberry pi. Qhov no ua tiav siv charlieplexing uas tau piav qhia zoo nkauj hauv cov lus qhia no (https://www.instructables.com/id/Charlieplexing-wi…). Saib xyuas kuv tab tom siv lub raj mis lub hau raws li qhia hauv cov duab saum toj no los npog kuv cov nyees khawm ntawm no kom haum tus qauv.
1. Ua ntej tso cov khub LED (thiab lawv qhov sib thooj sib thooj) XWB (ib qho liab lwm yam ntsuab lossis xim twg los xij uas koj xaiv) hauv qhov sib txawv ntawm qhov sib thooj hla tib kab hauv daim ntawv qhia zaub mov (saib daim duab saum toj no nrog pom hauv 1 khub). Ua kom ntseeg tau tias koj khaws tib ntu, piv txwv li sab saum toj yog ntsuab thiab hauv qab ib qho yog liab rau TXHUA LED khub.
2. Tom qab ntawv xaim cov LEDs (NCO TSEG: txhua lub xov hlau tswj mus rau LED khub ntawm 220 ohm resistor) siv cov lus qhia saum toj no - nws cov ncauj lus kom ntxaws nrog cov lus qhia txuas xov zoo, tsuas yog nco ntsoov koj tau tsim kab sib chaws nrog LEDs 0 thiab 1 ntawm sab saum toj sab laug thiab LEDs 16 thiab 17 nyob hauv qab txoj cai. (Tus lej LEDs pab nrog teeb tsa lub cev thiab kev ua haujlwm tom qab). LOSSIS ua raws cov xov hlau nyob hauv daim duab thib 2 kom pom tias kuv xaim cov LEDs li cas - saib cov kab xim hauv qab no ntws los ntawm kab saum toj mus rau kab hauv qab:
- Cov Hlau Dub (Pin 6 hauv av los ntawm pi) nyob rau saum toj kawg nkaus mus rau tag nrho txoj kev tsheb nqaj hlau - Kuv pub cov xaim no rau txhua ntawm 9 khawm
- Txiv kab ntxwv Hlau (Pin 7 - tswj tus pin1 los ntawm pi) hauv txoj kev tsheb nqaj hlau thib 2 saum LED 3 mus rau tag nrho txoj kev tsheb ciav hlau dua (-ive rail)
- Grey Hlau (Pin 11 - tswj tus pin2 los ntawm pi) hauv txoj kev tsheb nqaj hlau thib 2 saum toj no LED 3 mus rau tag nrho txoj kev tsheb nqaj hlau ib yam (+ive rail)
- Cov Hluav Taws Xob Hluav Taws Xob (Pin 12 - tswj tus pin3 los ntawm pi) hauv txoj kev tsheb nqaj hlau thib 3 saum LED 6 mus rau tag nrho txoj kev tsheb nqaj hlau (-ive rail)
- Xiav Hlau (Pin 13 - tswj tus pin4 los ntawm pi) hauv txoj kev tsheb nqaj hlau thib 3 saum LED 6 mus rau tag nrho txoj kev tsheb nqaj hlau (+ive rail)
- Ntsuab Hlau (Pin 15 - tswj tus pin5 los ntawm pi) hauv txoj kab 4 hauv qab LED 6 mus rau tag nrho txoj kev tsheb nqaj hlau (-ive rail)
Cov xov hlau yog xim xim yog li yuav tsum muaj peev xwm ua raws nrog - thov xyuas kom meej qhov sib txawv ntawm LEDs tau teeb tsa kom raug lwm qhov nws yuav tsis ua haujlwm !!
Kauj Ruam 2: Ntxiv 9 Nthuav Ib Sab ntawm LEDs
Ib sab ntawm txhua khub ntawm LEDs, ntxiv lub pob nyem tam sim no nrog ib txhais ceg sab hauv kab hauv av dub kab thiab lwm qhov rau hauv kab nrog xaim los ntawm raspberry pi. CEEB TOOM - Nws yog qhov zoo tshaj plaws los teeb tsa cov xov hlau txawm tias ua ntej muab cov nyees khawm tso rau hauv raws li qhia hauv daim duab hauv qib 1 yam tsis muaj khawm. Nws yuav yog qhov zoo tshaj plaws los teeb tsa cov xov hlau hauv av rau txhua 9 lub pob thiab tom qab ntawd teeb 9 lub xov hlau mus rau/los ntawm pi (tsis txhob txhawj xeeb txog dab tsi tus pin cov xov hlau tau los ntawm txij li koj feem ntau yuav tsis tau txuas cov xov hlau no rau pi tsis tau - yog li ua tib zoo ntxiv 9 xaim rau 9 khawm uas coj cov neeg siv nkag mus rau pi) raws li qhia hauv cov duab saum toj no.
Kauj Ruam 3: Txuas Cov Hlau Los Ntawm Breadboard mus rau Pi
Hauv 2 kauj ruam kawg peb tau txuas rau lub khob cij nrog LEDs thiab cov nyees khawm thiab lawv cov xov sib xws. Tam sim no peb txuas cov xov hlau no mus rau pi.
Raws li tau hais tseg hauv kauj ruam 1 - peb txuas 5 lub xov hlau tswj thiab xaim av dub rau LEDs rau tus pin xws li:
- Dub Hlau (Hauv av hlau) (Pin 6)
- Txiv kab ntxwv Hlau (Pin 7)
- Grey Hlau (Pin 11)
- Ntshav Hlau (Pin 12)
- Xiav Hlau (Pin 13)
- Ntsuab Hlau (Pin 15)
Tam sim no peb txuas 9 xov los ntawm 9 khawm mus rau pi. Nws yog qhov zoo tshaj los ua qhov sib tw sib tw ntawm 3 lub nyees khawm ua ke kom yooj yim rau kev tswj hwm xws li:
- khawm 0 (kab = 0, kab lus = 0) - xaim liab (sab saum toj sab laug) - Pin 29
- khawm 1 (kab = 0, kab ntawv = 1) - grey hlau - Tus lej 31
- khawm 2 (kab = 0, kab ntawv = 2) - txiv kab ntxwv hlau - Pin 32
- khawm 3 (kab = 1, kab lus = 0) - kab hlau daj - Pin 33
- khawm 4 (kab = 1, kab lus = 1) - grey hlau - Tus Pin 35
- khawm 5 (kab = 1, kab lus = 2) - txiv kab ntxwv hlau - Pin 36
- khawm 6 (kab = 2, kab lus = 0) - xaim daj - Pin 37
- khawm 7 (kab = 2, kab ntawv = 1) - grey hlau - Tus pin 38
- khawm 8 (kab = 2, kab lus = 2) - xaim dub - Pin 40
Thaum txhua qhov kev sib txuas tau ua tiav peb tau npaj siab xa cov cai !!
Kauj ruam 4: Upload Code
Thaum txhua qhov kev sib txuas tau ua tiav, peb tau npaj txhij xa cov cai. Piv txwv tias koj tau txuas nrog pi ntawm rdp LOSSIS VNC - thov khaws cov ntaub ntawv hauv qab no ntawm pi (hauv tib lub nplaub tshev) thiab khiav FinalVersion.py cov ntaub ntawv los ntawm lub dav hlau LOS YOG ntawm thonny. Kuj xyuas kom koj muaj koj tus neeg hais lus txuas nrog pi (hais lus bluetooth yuav ua tau ib yam).
Yog tias koj tau nyam ntawm ib qho twg thov qhia rau kuv paub thiab kuv yuav ua qhov zoo tshaj plaws los pab koj !!
PS: Nov yog thawj qhov kuv tau qhia, yog li qhia rau kuv paub tias kuv tau ua li cas !!: AW
Pom zoo:
Lub Tshuab Ntaus Ntawv - Tus Pabcuam Khoos Phis Tawj Khoos Phis Tawj: 7 Kauj Ruam (nrog Duab)
Lub Tshuab Ntaus Ntawv - Tus Pabcuam Khoos Phis Tawj Khoos Phis Tawj: Lub Tshuab Ntaus Ntawv yog tus pab tus kheej me me uas tuaj yeem tso saib ntau yam ntaub ntawv rub tawm los ntawm is taws nem. Cov cuab yeej no tau tsim thiab tsim los ntawm kuv rau CRT 420 - Chav Kawm Tshwj Xeeb Tshwj Xeeb ntawm Berry College uas yog Tus Thawj Coj
Khoos Phis Tawj Khoos Phis Tawj Khoos Phis Lawj: 3 Kauj Ruam
Khoos Phis Tawj Khoos Phis Tawj Khoos Phis Tawj: Qhov no yog txoj kev "dab tuag" los kho lub qhov (socket) ntawm lub laptop. Nws yuav yog ib qho lus me me hais lus phem, thov txim. Kuv tsis xav sau nws thaum kuv ua nws, yog li nws yog "tom qab qhov tseeb"
Kho Khoos Phis Tawj Khoos Phis Tawj: 13 Kauj Ruam
Kho Khoos Phis Tawj Khoos Phis Tawj: Cov lus qhia no yuav coj koj los ntawm kev kuaj mob thiab tej zaum yuav kho tau ntawm USB keyboard. Nyob rau niaj hnub no pov tseg tib neeg, peb zoo li khiav tawm thiab yuav cov keyboard pheej yig $ 15 los hloov peb cov keyboard zoo yav dhau los. Qhov no zoo li yog ib ntus
Hloov tawg DC Power Jack ntawm Koj Lub Khoos Phis Tawj Khoos Phis Tawj (Hloov Kho): 12 Kauj Ruam
Hloov tawg DC Power Jack ntawm Koj Lub Khoos Phis Tawj Khoos Phis Tawj (Hloov Kho): OK, Kuv tau coj kuv cov menyuam khiav ncig kuv chav thiab ua rau kuv lub laptop lub hwj chim txuas. Tom qab ntawd DC lub zog fais fab tau puas lawm. Kuv yuav tsum nco ntsoov nias lub nkaus kom them kuv lub laptop. Kuv mus txog qhov kuv txwv. Kuv yuav luag ntuav kuv lub computer tawm ntawm
Kho Khoos Phis Tawj Khoos Phis Tawj Hard Hard Ware Problem (system Disk Failure and Broken PSU and Missing/corrupt Files): 4 Kauj Ruam
Kho Khoos Phis Tawj Khoos Phis Tawj Khoos phis tawj nyuaj (System Disk Failure and Broken PSU and Missing/corrupt Files): Cov lus qhia no tsis tau ua tiav, kuv yuav ntxiv cov ntaub ntawv ntau ntxiv thaum twg kuv tau txais CHANCE yog tias koj xav tau kev pab nrog kho lub computer lossis yog tias koj muaj lus nug dab tsi xav hu rau kuv " Hauv cov lus qhia no kuv yuav qhia koj yuav kho kho com com yooj yim li cas