Cov txheej txheem:
- Khoom siv
- Kauj ruam 1:
- Kauj ruam 2:
- Kauj ruam 3:
- Kauj ruam 4:
- Kauj ruam 5:
- Kauj Ruam 6:
- Kauj ruam 7: Code
Video: Arduino Puzzle Box: 7 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
Rau qhov haujlwm no peb yuav ua lub thawv ntawv puzzle uas ua haujlwm nrog nkauj. Lub hauv paus tseem ceeb ntawm nws yog tias thaum koj nias lub pob nws tso lub suab thiab Arduino xam lub pob twg raug nias kom nws paub tias qhov twg yog thiab qhov twg yog cov lus teb tsis raug.
Khoom siv
1 x Arduino ib
1 x 1k Ohm resistor
5 x 220 Ohm resistors
1 xPiezo Buzzer
5 x pushbutton 6 x 6 mm
1 x teeb Jumper xov hlau
1 x perf/strip board
1 x solderset
1x cev
1 x klub
1 x lub hauv siab me me ntawm tub rau khoom/ntoo
1 x kub kua nplaum phom + kua nplaum
1x9v roj teeb + tus tuav
wb worbla
xim
Kauj ruam 1:
Txhawm rau pib nrog koj yuav tsum nias koj tus pin hauv koj daim ntawv qhia zaub mov. Tam sim no txuas analog 2 nrog xaim mus rau kaum ntawm lub rooj tsavxwm. Peb yuav txuas ob lub resistors rau nws hauv kab. Thawj yog 10k Ohm resistor. Txog rau lwm qhov kawg ntawm tus tiv thaiv no peb txuas xaim mus rau hauv av analog. Tus tiv thaiv thib ob yog 220 Ohm resistor peb txuas rau thawj lub pob. Siv lwm tus tiv thaiv ntawm tus nqi qub txhawm rau txhawm rau txuas ob sab qhib ntawm lub pob nrog khawm thib ob. Khaws txuas cov nyees khawm zoo li no mus txog qhov kawg. Thaum kawg koj yuav tau xaim hlau thiab txuas nws mus rau ib sab uas raug kaw ntawm lub pob thiab txuas nws mus rau kab tom ntej. Tam sim no koj rov ua cov txheej txheem uas koj tau ua nrog cov neeg tawm tsam tsuas yog paub nrog cov xov hlau yooj yim. Txuas thawj lub khawm mus rau qhov sib piv 3, 3V chaw nres nkoj ntawm koj Arduino. Txhua yam koj xav tau ib hom txiv leej tub zoo li cov duab hauv qab no.
Kauj ruam 2:
Tom ntej txuas koj lub suab nrov rau hauv lub khob cij thiab ruaj ntseg ib sab mus rau hauv av digital thiab lwm qhov mus rau 12 chaw nres nkoj. Nws yog qhov ntse los twb tau xa cov cai hauv qab no rau hauv koj Arduino yog li koj tuaj yeem sim yog tias txhua yam ua haujlwm raug. Yog tias nws yog koj tuaj yeem pib siv cov khoom sib xyaw ua ke. Ua qhov no los ntawm kev coj lawv tawm ntawm lub khob cij thiab siv cov xov hlau thiab kev sib txuas ua ke ncaj qha. Yog tias koj xav tias koj xav tau ntev dua nyob nruab nrab ntawm cov nyees khawm koj tuaj yeem ntxiv qee cov xaim ntxiv hauv nruab nrab ntawm cov resistors. Lub khob cij tsis tsim nyog nyob rau lub sijhawm no.
Kauj ruam 3:
Tom qab txhua yam tau muag nws nws yog lub sijhawm los ua lub thawv nws tus kheej. Kuv siv cov khoom pheej yig ntawm cov tub rau khoom ua lub hauv paus rau kuv. Kuv tsuas yog txiav ib nrab qhov ntev thiab tshem lub nraub qaum thiab sab uas kuv txiav los. Koj yuav tsum muaj ob daim zoo li c tam sim no. Txiav ib sab ntawm ib qho ntawm lawv los siv ua lub hau. Tam sim no tig ib qho ntawm cov khoom seem kom lawv haum ua ke zoo li lub thawv uas tsis muaj lub hau thiab lo lawv ua ke. Thaum cov kua nplaum tau teeb tsa kom raug, laum ib lub qhov me me ntawm txhua sab ntawm lub npov rau cov nyees khawm thiab loj dua rau lub suab nrov hauv lub hau.
Kauj ruam 4:
Tam sim no koj tuaj yeem pleev xim rau lub thawv. Kuv tau ua kuv li nrog paj tsim raws BOTW tab sis koj tuaj yeem xaiv qhov tsim koj xav tau tiag tiag. Tom qab qhov no ua tiav koj tuaj yeem tso cov nyees khawm sab hauv lub qhov thiab muab cov kua nplaum tso rau tom qab ntawm lub pob thiab cov ntoo ib puag ncig. Cov hauv paus ntsiab lus zoo ib yam siv rau lub buzzer tab sis kuv haum zoo hauv lub qhov ua rau nws tsis tsim nyog. Tom ntej no koj rub qee cov worbla thiab cua sov thiab txiav nws txhawm rau ua qee cov nyees khawm me me. Ua tib zoo lo lawv mus rau cov nyees khawm tab sis nco ntsoov tsis txhob siv cov kua nplaum ntau vim tias koj yuav yuam kev tau cov nyees khawm nyam. Tam sim no koj tuaj yeem pleev xim rau lawv txhawm rau ua kom lawv sib xyaw nrog lub thawv ntau dua.
Kauj ruam 5:
Thaum kawg koj muab cov kua nplaum los yog cov ntsia hlau, lub clamp thiab lub hinges ntawm lub thawv thiab lub hau txuas ob.
Kauj Ruam 6:
Tam sim no koj lub thawv ua tiav txhua yam koj yuav tsum ua yog tso Arduino thiab roj teeb sab hauv nws thiab kaw lub hau.
Kauj ruam 7: Code
// Qhov no yog txoj cai rau Zelda themed puzzle/music box.
// qhov no txuas koj cov cai rau cov npe ntawm cov ntawv hauv yhe lwm tab
#suav nrog "pitches.h"
// qhov kev hloov pauv no yuav ua kom ntseeg tau tias Arduino pom kev nias lub pob ntev dua li tsuas yog nias ib zaug
int ib = 0;
// los ntawm no nws yuav nyeem koj cov tswv yim
koj k = 2;
// qhov no yog koj tus pin tso tawm
tus neeg hais lus = 12;
// hauv qab no yog cov nkauj kawg
int Zelda = {NOTE_B4, NOTE_D5, NOTE_A4, NOTE_G4, NOTE_A4, NOTE_B4, NOTE_D5, NOTE_A4, NOTE_G4, NOTE_A4, NOTE_B4, NOTE_D5, NOTE_A5, NOTE_G5, NOTE_D5, NOTE_C5, NOTE_B4, NOTE_A5;
int ZeldaTime = {2, 4, 2, 4, 4, 2, 2, 4, 4, 4, 2, 4, 2, 4, 2, 4, 4, 2};
int Epona = {NOTE_D5, NOTE_B4, NOTE_A4, NOTE_D5, NOTE_B4, NOTE_A4, NOTE_D5, NOTE_B4, NOTE_A4, NOTE_B4, NOTE_A4};
int EponaTime = {4, 4, 1.5, 4, 4, 1.5, 4, 4, 4, 2, 2, 1};
int Saria = {NOTE_F4, NOTE_A4, NOTE_B4, NOTE_F4, NOTE_A4, NOTE_B4, NOTE_F4, NOTE_A4, NOTE_A4, NOTE_B4, NOTE_E5, NOTE_D5, NOTE_B4, NOTE_C4, NOTE_B4, NOTE_G4, NOTE_E4, NOTE_D4, NOTE_E4, NOTE_E4, NOTE_E4, NOTE_E4, NOTE_E4, NOTE_E4, NOTE_E4, NOTE_E4, NOTE_E4, NOTE_E4, NOTE_E4, NOTE_E4, NOTE_E4, NOTE_E4, NOTE_E4, NOTE_E4, NOTE_E4, NOTE_E4, NOTE_E4, NOTE_E4, NOTE_E4, NOTE_E4, NOTE_E4, NOTE_E4, NOTE_E4, NOTEBE, int SariaTime = {8, 8, 4, 8, 8, 4, 8, 8, 8, 8, 4, 8, 8, 8, 8, 8, 3, 8, 8, 8, 2, 1};
// lub sijhawm ib txwm ntawm daim ntawv
int BEATTIME = 300;
// lub txee uas yuav taug qab yog peb nyob hauv qhov kev daws teeb meem
int tus qhia = 0;
void teeb tsa () {
Serial.begin (9600);
pinMode (2, INPUT);
pinMode (1, INPUT);
}
void voj () {
// nyeem cov tswv yim los ntawm tus pin
k = analogRead (2);
int p = analogRead (1);
// yog tias tsis muaj ib lub pob nyem yuav tsum tsis muaj suab nrov
yog (tus qhia == 0) {
noTone (12);
}
// yog tias cov ntaub ntawv nyeem tau sib xws nrog cov ntsuas tsis tau piav qhia me ntsis ntawm cov cai
yog tias (k> 320 && k <350) {
rov ();
}
//""
lwm yog tias (k 290) {
txuas ();
}
//""
lwm yog tias (k> 260 && k <280) {
sib cog lus ();
}
//""
lwm yog (k> 240 && k <260) {
lwm tus ();
}
//""
lwm yog (k> 220 && k <240) {
ib ();
}
// yog tias nws tsis (thaum tsis muaj khawm raug nias), khiav cov cai no
lwm tus {
// rov pib dua ib yam yog li nws tuaj yeem siv lub sijhawm tom ntej lub pob nyem
ib yam = 0;
// yog tias lub txee nce mus txog qee tus lej khiav cov lus piav me ntsis ntawm cov cai
yog tias (qhia == 166) {
zelda ();
}
//""
lwm yog (qhia == 386) {
zias ();
}
//""
lwm yog (qhia == 266) {
epona ();
}
//""
lwm tus yog (tus qhia == 999) {
// ua si lub suab no los cim qhov ua yuam kev
suab nrov (hais lus, NOTE_C3, BEATTIME);
// rov pib lub txee rau 0
tus qhia = 0;
}
}
// qhov ncua ntawm cov tswv yim thiab cov zis
ncua (100);
// luam tawm qhov tseem ceeb ntawm koj cov tswv yim hauv cov ntawv saib
Serial.println (k);
}
// qhov no yog thawj zaj nkauj
void zelda () {
// qhov no teeb tsa lub txee uas hloov kho nws tus kheej thaum ua suab paj nruag yog li nws tuaj yeem nyeem nws thiab nres thaum nws yuav tsum tau
rau (int kuv = 0; kuv <sizeof (Zelda); kuv ++) {
// hais tias yuav tsum sau ntawv ntev npaum li cas
int ZTime = 1000 / ZeldaTime [kuv];
// tsim cov tones
suab nrov (hais lus, Zelda , ZTime);
// tsim qhov raug ncua
int ncua = ZTime * 1.30;
ncua (ncua);
// resets txee
tus qhia = 0;
// luam tawm qhov tseem ceeb ntawm koj cov tswv yim hauv cov ntawv saib
Serial.println (tus qhia);
}
}
//""
tsis muaj dab tsi epona () {
rau (int kuv = 0; kuv <sizeof (Epona); kuv ++) {
int ETime = 1000 / EponaTime [kuv];
suab nrov (hais lus, Epona , ETime);
int ncua = ETime * 1.30;
ncua (ncua);
tus qhia = 0;
Serial.println (tus qhia);
}
}
//""
tsis muaj dab tsi saria () {
rau (int kuv = 0; kuv <sizeof (Saria); kuv ++) {
int Sijhawm = 1000 / SariaTime ;
suab nrov (hais lus, Saria , Sijhawm);
int ncua = Sijhawm * 1.30;
ncua (ncua);
tus qhia = 0;
Serial.println (tus qhia);
}
}
void rov
hts () {
// yog tias qhov no tseem tsis tau nias
yog (tib yam == 0) {
// yog tias lub txee tam sim no muaj ib qho ntawm cov txiaj ntsig no ntxiv qhov no rau nws
yog (tus qhia == 0 || tus qhia == 132 || tus qhia == 165 || tus qhia == 232 || tus qhia == 265 || tus qhia == 331 || tus qhia == 374) {
tus qhia = tus qhia + 1;
}
// txwv tsis pub teeb nws rau 999 yog li koj hnov suab yuam kev
lwm tus {
qhia = 999;
}
// teeb tsa tib yam rau ib qho kom Arduino tsis nyeem xovxwm ntev li ntau yam nias
ib yam = 1;
}
// ua suab nrov
lwm tus {
suab nrov (hais lus, NOTE_A4, BEATTIME);
}
// luam tawm qhov tseem ceeb ntawm koj cov tswv yim hauv cov ntawv saib
Serial.println (tus qhia); }
//""
void txuas () {
yog (tib yam == 0) {
yog (tus qhia == 133 || tus qhia == 254 || tus qhia == 244 || tus qhia == 332 || tus qhia == 375 || tus qhia == 221) {
tus qhia = tus qhia + 11;
}
lwm tus yog (tus qhia == 0) {
qhia = 111;
}
lwm tus {
qhia = 999;
}
ib yam = 1;
lwm yam {
suab nrov (hais lus, NOTE_B4, BEATTIME);
} Serial.println (tus qhia);
}
//""
tsis muaj dabtsis boven () {
yog (tib yam == 0) {yog (tus qhia == 111 || tus qhia == 144 || tus qhia == 233) {
tus qhia = tus qhia + 21;
}
lwm tus yog (tus qhia == 0) {
qhia = 221;
}
lwm tus {
qhia = 999;
}
ib yam = 1;
}
lwm tus {
suab nrov (hais lus, NOTE_D5, BEATTIME);
Serial.println (tus qhia);
}
}
//""
void onder () {
yog (tib yam == 0) {
yog tias (qhia == 343) {
tus qhia = tus qhia + 31;
}
lwm tus yog (tus qhia == 0) {
qhia = 331;
lwm yam {
qhia = 999;
} ib yam = 1;
lwm yam {
suab nrov (hais lus, NOTE_F4, BEATTIME);
Serial.println (tus qhia);
}
}
//""
void ib () {
yog (tib yam == 0) {
yog (tus qhia == 0) {
qhia = 461;
}
lwm tus {
qhia = 999;
}
ib yam = 1;
}
suab nrov (hais lus, NOTE_D4, BEATTIME);
Serial.println (tus qhia);
}
Pom zoo:
Arduino Tsheb Rov Qab Chaw Nres Tsheb Ceeb Toom - Cov Kauj Ruam ntawm Kauj Ruam: 4 Kauj Ruam
Arduino Tsheb Rov Qab Chaw Nres Tsheb Ceeb Toom | Cov kauj ruam ib kauj ruam: Hauv txoj haujlwm no, kuv yuav tsim qhov yooj yim Arduino Tsheb Rov Qab Tsheb Nres Tsheb Nres Sensor Siv Arduino UNO thiab HC-SR04 Ultrasonic Sensor. Qhov no Arduino raws Lub Tsheb Rov Qab ceeb toom tuaj yeem siv rau Kev Tshawb Fawb Txog Tus Kheej, Robot Ranging thiab lwm yam
Qhib Txoj Cai Game, Arduino Raws Puzzle Box: 4 Cov Kauj Ruam (nrog Duab)
Nyiam Txoj Cai Game, Arduino Raws Puzzle Box: Hauv Cov Lus Qhia no, Kuv yuav los qhia koj yuav tsim koj li cas txhawm rau txhim kho koj tus kheej qhov kev ua si qhov chaws uas koj siv tus lej nkag teb chaws teb kom kwv yees cov lej tsim tawm kom muaj kev nyab xeeb. Muaj 8 LEDs nyob rau pem hauv ntej ntawm kev nyab xeeb los qhia koj pes tsawg ntawm
RC Taug Qab Neeg Hlau Siv Arduino - Kauj Ruam Ib kauj ruam: 3 Kauj Ruam
RC Tracked Robot Siv Arduino - Kauj Ruam Ib Nrab: Hav guys, Kuv rov qab los nrog lwm tus neeg hlau txias chassis los ntawm BangGood. Vam tias koj tau dhau los ntawm peb cov phiaj xwm yav dhau los - Spinel Crux V1 - Tus Cwj Pwm Tswj Tus Neeg Hlau, Spinel Crux L2 - Arduino Xaiv thiab Muab Neeg Hlau nrog Robotic caj npab thiab Badland Braw
DIY Arduino Robotic Arm, Kauj Ruam ntawm Kauj Ruam: 9 Kauj Ruam
DIY Arduino Robotic Arm, Kauj Ruam ntawm Kauj Ruam: Cov ntawv qhia no yog qhia koj yuav tsim lub Caj Npab Caj Npab ntawm koj tus kheej li cas
Puzzle Box - Codebreakers thiab Groundbreakers [UCM]: 7 Cov Kauj Ruam (nrog Duab)
Puzzle Box - Codebreakers thiab Groundbreakers [UCM]: Lub laser txiav puzzle lub thawv khoom siv tsim rau kev ua haujlwm tsim khoom digital ntawm Lub Tsev Khaws Khoom Fitzwilliam, Cambridge txuas nrog lawv cov Codebreakers thiab Groundbreakers exhibition. Txog rau kev cob qhia, lub pob hauv lub thawv ntawv sib txuas tau txuas nrog MakeyMakey a