Cov txheej txheem:
- Kauj Ruam 1: Tsim Rooj Plaub
- Kauj Ruam 2: Txhim Kho Lub Tshuab Flipper
- Kauj Ruam 3: Tso Cov Phab Ntsa
- Kauj Ruam 4: Ntxiv Cov Ntawv Pov Thawj
- Kauj Ruam 5: Ntxiv Kev Ua Si dhau Kev Sib Tham
- Kauj Ruam 6: Drilling Cov Kab Qhov
- Kauj Ruam 7: Txhim Kho Txhua Yam
- Kauj Ruam 8: Tshaj Tawm Txoj Cai
Video: Arduino: Pinball Tshuab: 8 Kauj Ruam (nrog Duab)
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:29
Raws li kuv ib txwm nyiam ob lub tshuab pinball, thiab khoom siv hluav taws xob, Kuv txiav txim siab tsim kuv tus kheej lub tshuab pinball. Kuv tau xaiv Arduino rau lub phiaj xwm thiab khoom siv hluav taws xob, vim tias nws yog lub platform siv tau yooj yim uas yog ob qho yooj yim thiab siv tau yooj yim.
Hauv phau ntawv qhia no kuv yuav piav qhia kuv cov txheej txheem txhim kho, yog li tej zaum ib ntawm koj cov neeg nyiam ua haujlwm tuaj yeem tsim qee yam zoo ib yam.
Kauj Ruam 1: Tsim Rooj Plaub
Cia peb pib nrog rooj plaub ntawm lub tshuab pinball. Kuv ua ib qho kev tsim yooj yim haum. Kuv tau pom daim phaj hauv qab, thiab siv 4 tus ncej ntoo me me nyob hauv cov ces kaum los txuas rau phab ntsa. Qhov loj ntawm koj rooj plaub yog koj tus kheej xaiv, Kuv tau xaiv ua kom nws me dua me dua lub tshuab pinball thawj vim kuv tsis tau npaj rau kev ntxiv ib qho tshwj xeeb zoo tshaj rau ntxiv rau qhov chaw. Kuv siv ob lub ntsia hlau thiab kua nplaum los ua rooj plaub kom ruaj khov li sai tau. Sab nraub qaum kuv tau hlais ob lub qhov hauv hauv av rau ob txhais ceg uas yuav muab lub tshuab pinball lub cim qaij. Ib zaug ntxiv, qhov siab ntawm ob txhais ceg yog tag nrho rau koj. Qhov siab koj ua ob txhais ceg, lub pob yuav nrawm dua (qis dua).
Kauj Ruam 2: Txhim Kho Lub Tshuab Flipper
Raws li kuv xav txwv tus nqi ntawm txoj haujlwm no, Kuv tau txiav txim siab ua kom lub tshuab ntxhua khaub ncaws tsis siv hluav taws xob. Yog tias koj txaus siab rau hluav taws xob hluav taws xob, koj tuaj yeem siv kev tsim kho uas zoo ib yam, tab sis nrog lub npe hu ua 'solenoid' txuas nrog nws (solenoids nrog lub zog txaus los tswj cov flippers tau kim heev rau kuv).
Kuv pib los ntawm kev drilling ob qhov hauv qab rau qhov pivot point ntawm ob lub flippers. Kuv drilled qhov (hauv kuv lub tswv yim) me ntsis nyob ze rau ib leeg, thiab qhov no ua rau qhov kev ua si yooj yim me ntsis thaum kawg. Yog li ceev faj tsis txhob tso cov flippers ze rau ib leeg, tshwj tsis yog tias koj xav tau qhov yooj yim ntawm kev ua si.
Kuv kuj tau laum ob lub qhov nyob hauv ob sab phab ntsa sib dhos rau qhov flipper qhov. Cov qhov no yog siv rau ob lub khawm flipper.
Kuv siv cov dej ntws los rub lub flippers rov qab rau hauv txoj haujlwm qub, thiab ua qhov piv piv ntawm cov flippers thiab cov nyees khawm kom lawv tig thaum cov nyees khawm raug nias. Txhawm rau nres cov dej ntws los ntawm kev rub rov qab lub flippers nyob deb, Kuv tau muab ob lub ntsia hlau los tuav lub flippers hauv lawv txoj haujlwm qub.
Kauj Ruam 3: Tso Cov Phab Ntsa
Kuv tau tso ob peb phab ntsa los hloov tus pinball mus rau ntawm lub flippers. Lawv yooj yim heev los ua. Tsuas yog laum 3 qhov hauv qab ntawm rooj plaub, thiab thawb peb lub pins ntoo. Qhwv ib txoj hlua roj hmab ncig cov pins thiab koj ua tiav.
Kauj Ruam 4: Ntxiv Cov Ntawv Pov Thawj
Cov qhab nias yog ib qho tseem ceeb tshaj plaws ntawm lub tshuab pinball, yog li xyuas kom koj ua qhov no kom raug. Kuv tau ua peb qhov qhab nia rau kuv lub tshuab pinball, tab sis qhov no yog txhua yam rau koj.
Kuv pom ib daim me me ntawm tus pas txhuam hniav, thiab qhwv tooj liab xaim ncig nws. Arduino yuav ua kom lub zog tooj liab no txuas nrog 5V. Kuv tau siv plaub tus pas nrig los rau sab kom sib cuag tau zoo nrog pob.
Txoj hauv kev uas cov qhab nia ua haujlwm, yog lub pob ua tiav qhov Circuit Court uas ua rau tus pin nkag ntawm Arduino. Yog li qhov kuv tau ua yog daim kab xev aluminium ntawv ci rau hauv qab ntawm rooj plaub (TSIS YOG KOOB TEEB MEEM) thiab xaim cov ntawv ci mus rau tus pin ntawm Arduino. Thaum twg los xij lub pob tsoo ob qho tib si tooj liab thiab txhuas, kev ua haujlwm tau tiav thiab Arduino yuav tau txais lub teeb liab.
Kuv txuas txhua qhov ntawm cov qhab nia ua ke siv cov ntawv txhuas, tab sis nco ntsoov tias sab nplaum tsis ua hluav taws xob.
Kauj Ruam 5: Ntxiv Kev Ua Si dhau Kev Sib Tham
Hauv qab ntawm lub tshuab pinball, nyob nruab nrab ntawm cov flippers, Kuv tau ntxiv kev ua si dhau kev sib cuag. Thaum twg lub pob tsoo qhov kev sib cuag no, tus neeg uas ua ntawv yuav poob pob. Kev tsim kho kuv tau ua yog zoo ib yam li cov qhab nias. Tsuas yog nyob ntawm no kuv siv ob lub hau ntswj, thiab rov ua ib daim ntawm txhuas ntawv ci rau hauv qab.
Kauj Ruam 6: Drilling Cov Kab Qhov
Ua ntej peb pib txuas txhua yam mus rau Arduino, peb yuav tsum tau laum ob peb qhov rau cov xaim ua ntej. Kuv drilled ib lub qhov los ntawm ob daim ntawm txhuas ntawv ci, yog li ib lub qhov hauv cov ntawv ci txhuas nyob ze rau cov qhab nia, thiab ib lub qhov hauv cov ntawv ci txhuas nyob ze qhov kev ua si dhau kev sib cuag.
Dhau li ntawm qhov no, Kuv kuj tau laum ib lub qhov nyob hauv qab sab laug, nyob nruab nrab ntawm cov phab ntsa, rau txoj hlua txuas mus rau lub qhov rooj ntxiv pob Servo.
Yuav tsum muaj qhov rau cable txuas nrog LCD hauv qab.
Kauj Ruam 7: Txhim Kho Txhua Yam
Kuv tau ua cov txheej txheem no kom muaj kev txheeb xyuas zoo dua qhov twg txhua cov kab hluav taws xob yuav tsum mus. Cov ntoo khaub lig yog cov ntsiab lus uas cov xov hluav taws xob txuas. Kuv tau sim ua kom ntau li ntau tau kom txhua yam me ntsis khov kho thiab ntseeg tau. Kev thaiv yuav siv sijhawm me ntsis, tab sis tom qab ua tiav qhov no koj yuav luag nyob ntawd!
Kauj Ruam 8: Tshaj Tawm Txoj Cai
Tshaj tawm cov cai hauv qab no rau koj Arduino kom ua rau koj lub tshuab pinball los nyob!
// Suav nrog lub tsev qiv ntawv rau lub lcd
#ncig #ncig
// Pib lub lcd cov ntaub ntawv pins
LiquidCrystal lcd (7, 8, 9, 10, 11, 12);
// Tsim servo
Servo ballGateServo;
// Tsim cov kev hloov pauv rau tus pin peb siv
int gameoverPin = 6; int scorePin = 5; int speakerPin = 4; int ballGateServoPin = 3;
// Pib pib hloov pauv kev ua si rau lub tshuab pinball
int tau = 0; tus qhab nia siab = 500; bool highscoreReached = tsis tseeb; int cov = 3; int gameoverTimer = 0; int gameoverTimerDuration = 100; bool gameoverTriggered = tsis tseeb;
// khiav cov cai no ib zaug ntawm thawj kab ntawv
teeb tsa tsis muaj dab tsi () {// Teeb tus pinMode rau tus pin peb siv pinMode (gameoverPin, INPUT); pinMode (scorePin, INPUT);
// Pib lub lcd los ntawm kev muab qhov dav thiab qhov siab
lcd.begin (16, 2);
// Txuas lub pob qhov rooj servo rau tus pin uas haum
ballGateServo.attach (ballGateServoPin);
// Pib dua lub qhov rooj servo rau txoj haujlwm pib
ballGateServo.write (0); }
// Khiav cov cai no txhua tus ncej
void loop () {// Capture tus pin inputs int gameoverState = digitalRead (gameoverPin); int scoreState = digitalRead (scorePin);
// Ntxiv rau qhov qhab nia yog tias tau txais cov lus pom
yog (scoreState) {suab (speakerPin, 1000); tau += 10; } lwm {noTone (4); }
// Rho tawm los ntawm cov pob yog tias qhov gameover pit tau ua rau
yog (gameoverState thiab! gameoverTriggered) {pob -= 1; gameoverTriggered = tseeb; gameoverTimer = gameoverTimerDuration; }
// Pib lub gameover timer sai li sai tau lub pob tsis tau kov gameover hu
yog (! gameoverState) {yog (gameoverTimer> = 1) {gameoverTimer -= 1; } lwm {gameoverTriggered = tsis tseeb; }}
// Nyem qhov gameover cov ntawv rau lub lcd thiab rov pib dua cov qhab nia thiab pob
yog (pob <= 0) {lcd.setCursor (0, 0); rau (int i = 5; i> = 1; i--) {lcd.clear (); ncua (250); lcd.print ("GAME OVER"); lcd.setCursor (0, 1); lcd.print ("Sim dua?"); ncua (250); } lcd.clear (); tau = 0; ballGateServo.write (0); highscoreReached = tsis tseeb; pob = 3; }
yog (qhab nia> qhab nia siab thiab! highscoreReached) {
lcd.setCursor (0, 0); rau (int i = 5; i> = 1; i--) {lcd.clear (); ncua (250); lcd.print ("HIGHSCORE TSHIAB"); lcd.setCursor (0, 1); lcd.print ("Kev tuag sai sai!"); ncua (250); } lcd.clear (); pob = 1; ballGateServo.write (120); highscore = qhab nia; highscoreReached = muaj tseeb; }
// Hloov kho cov qhab nia siab yog tias cov qhab nia tam sim no siab dua
yog (qhab nia> qhab nia siab) {highscore = qhab nia; }
// Teeb tus cursor rau kab 0
lcd.setCursor (0, 0); // Luam tawm tam sim no (siab) tus lej rau lcd yog (qhab nia <= 0) {lcd.print ("Highscore:" + String (highscore) + ""); } lwm {lcd.print ("Qeb:" + Txoj hlua (qhab nia) + ""); }
// Teeb tus cursor rau kab 1
lcd.setCursor (0, 1);
// Luam tawm cov nyiaj tam sim no ntawm lub lcd
lcd.print ("Pob:" + Cov hlua (pob)); }
Pom zoo:
Arduino Pinball Tshuab Uas Ua Nws Tus Kheej !: 13 Cov Kauj Ruam (nrog Duab)
Arduino Pinball Machine Uas Ua Nws Tus Kheej!: &Quot; Lub tshuab pinball uas ua nws tus kheej, tsis yog txhua qhov kev lom zem tawm ntawm nws? &Quot; Kuv hnov koj nug. Tej zaum yog tias koj tsis nkag mus rau hauv cov neeg hlau tsis siv neeg nws yuav yog. Txawm li cas los xij, Kuv yog txhua yam txog kev tsim cov neeg hlau uas tuaj yeem ua cov khoom txias, thiab qhov no
YUAV UA LI CAS YUAV TSHUAB TSHUAB TSHUAB NROG NROG ARDUINO: 8 Kauj Ruam
YUAV UA LI CAS YUAV TSUM TSHUAB TSHUAB TSHUAB NROG ARDUINO: QHOV TSEEB Lub tshuab sau ntawv tau tsim los ntawm cov ntaub ntawv uas tuaj yeem tau yooj yim hauv tsev; nws ua rau siv rau lub cav hluav taws xob uas yog lub hauv paus tseem ceeb ntawm nws txoj haujlwm. Nws tuaj yeem siv hauv Kev kos duab Engineering thiab kos duab kos duab. Nws tuaj yeem yog
Tabletop Pinball Tshuab Siv Evive- Arduino Raws Li Cov Plaform: 18 Cov Kauj Ruam (nrog Duab)
Tabletop Pinball Tshuab Siv Evive- Arduino Raws Li Kev Tso Plaform: Lwm lub asthiv, lwm qhov kev lom zem! Thiab lub sijhawm no, nws tsis yog lwm qhov tshaj li txhua tus nyiam kev ua si arcade - Pinball! Txoj haujlwm no yuav qhia koj yuav ua li cas ua koj tus kheej Pinball tshuab yooj yim hauv tsev. Txhua yam koj xav tau yog cov khoom siv los ntawm evive
Arduino CNC Plotter (TSHUAB TSHUAB): 10 Kauj Ruam (nrog Duab)
Arduino CNC Plotter (TSHUAB TSHUAB): Hav guys! Kuv vam tias koj twb nyiam kuv cov lus qhia yav dhau los " Yuav ua li cas thiaj ua rau koj tus kheej Arduino kev qhia ua haujlwm platform " thiab koj tau npaj rau qhov tshiab, raws li ib txwm kuv tau ua cov lus qhia no los qhia koj ib qib zuj zus thaum ua qhov zoo li no zoo kawg nkaus
Arduino Raws Tshuab raj nplaim tshuab: 10 Kauj Ruam (nrog Duab)
Arduino Raws Tshuab raj nplaim tshuab: Hauv qhov kev qhia no, Kuv sim nthuav qhia qhov haujlwm uas sib txuas nrog kev kos duab nrog engineering. Lub tshuab uas ua lub tshuab raj. Nws tswj cov ntawv sau siv Arduino. Ntau lub suab nkauj lossis nkauj tuaj yeem ua haujlwm ntawm Arduino, uas Arduino ua suab nrov ntawm lub raj raj. Tsis muaj