Mundarija:
2025 Muallif: John Day | [email protected]. Oxirgi o'zgartirilgan: 2025-01-13 06:58
Materiallar
1 o'rinli arduino
1 ta himoya paneli
1 ta potentsial
1 ta zumbador
2 boton puentes
1 pantalla LCD 16X2
1 ta MDF plankasi (pul uchun)
1 -qadam: Armar El -Circuito
Materiallar va elektron qurilmalar yordamida. Bu birinchi navbatda LCD displeyni Arduino -ga tegishli. Orqa va pastki qismdagi botonlarni buzadigan joylar (elektron tasvirlar).
2 -qadam: Armar La Caja Utilizando La Cortadora Laser
Bu 2 boton, potentsial, ovozli signal, shovqin -suronli konferentsiya uchun eng yaxshi variant. Umumiy foydalanish mumkin emas. Silicon líquido (recomendado) yoki kola blanka uchun mo'ljallangan.
3 -qadam: Dekoratsiya
Ommaviy axloq qoidalariga rioya qilmaslik uchun, siz diskotekalar, diskotekalar, musiqiy musiqalar va musiqiy asarlar bilan tanishishingiz mumkin.
4 -qadam: Montar El Circuito En La Caja
Primera, con los stikerlari old tomondan bezatilgan. Al -Arduino -da (5 -chi bosqichda), shuningdek, botonlarni, shuningdek, LCD displeyni o'rnatish va o'rnatishning eng yaxshi usuli hisoblanadi.
5 -qadam: Arduino dasturining dasturi
#qo'shing
LiquidCrystal lcd (12, 11, 7, 8, 9, 10);
// TAXTLAR O'YINI--------------------------------------------- #define NOTE_B0 31 #devetine NOTE_C1 33 #devetine NOTE_CS1 35 #de NOTEINE NOTE_D1 37 #de NOTEINE NOTE_DS1 39 #deinine NOTE_E1 41 #deFine NOTE_F1 44 #de NOTEFINE NOTE_FS1 46 #deFine NOTE_G1 49 #efine NOTEINEEFSEEEFEE511 # NOTE_B1 62 #define NOTE_C2 65 #devetine NOTE_CS2 69 #de NOTINE NOTE_D2 73 #de NOTINE NOTE_DS2 78 #deineFine NOTE_E2 82 #de NOTINE NOTE_F2 87 #deFINE NOTE_FS2 93 #define NOTE_G2 98 #de NOTINE_GS2 104 #Define2 #define NOTE_C3 131 #devetine NOTE_CS3 139 #devetine NOTE_D3 147 #de NOTEINE NOTE_DS3 156 #define NOTE_E3 165 #define NOTE_F3 175 #define NOTE_FS3 185 #define NOTE_G3 196 #de NOTE NOTE_GS3 208 #3define, NOTE_C4 262 #devet NOTE_CS4 277 #devetine NOTE_D4 294 #devetine NOTE_DS4 311 #deinine NOTE_E4 330 #define NOTE_F4 349 #devetine NOTE_FS4 370 #devetine NOTE_G4 392 #devetine NOTE_GS4 415 #define 0 #define NOTE_AS4 466 #devetine NOTE_B4 494 #de NOTINE NOTE_C5 523 #de NOTINE NOTE_CS5 554 #deINEE NOTE_D5 587 #deFINE NOTE_DS5 622 #deINE NOTEEE 6565 NOTE_AS5 932 #devetine NOTE_B5 988 #devetine NOTE_C6 1047 #devetine NOTE_CS6 1109 #de NOTINE NOTE_D6 1175 #deFINE NOTE_DS6 1245 #de NOTINE NOTEE 1319 #deFINE NOTE_F6 1397 #efine NOTE_FS6 1480 NOT6666666 1865 #define NOTE_B6 1976 #devetine NOTE_C7 2093 #devetine NOTE_CS7 2217 #de NOTINE NOTE_D7 2349 #de NOTINE NOTE_DS7 2489 #deFine NOTE_E7 2637 #de NOTINE_F7 2794 #deFine NOTE_FS7 2960 #DEFEE_EFF_77_77 NOTE_B7 3951 ta'rifini belgilang NOTE_C8 4186 #ni belgilang NOTE_CS8 4435 #ni belgilang NOTE_D8 4699 #ni belgilang NOTE_DS8 4978 // Shirin bola O MINI ------------------------- ---------------- #define NOTE_B0 31 #devetine NOTE_C1 33 #define NOT E_CS1 35 #define NOTE_D1 37 #devetine NOTE_DS1 39 #devetine NOTE_E1 41 #deinine NOTE_F1 44 #deinine NOTE_FS1 46 #de NOTINE NOTE_G1 49 #de NOTINE NOTE_GS1 52 #define NOTE_A1 55 #de NOTEASEASE_ 581 NOTEFINE #define NOTE_D2 73 #devetine NOTE_DS2 78 #devetine NOTE_E2 82 #de NOTINE NOTE_F2 87 #de NOTINE NOTE_FS2 93 #define NOTE_G2 98 #deFine NOTE_GS2 104 #deFINE NOTE_A2 110 #deFine NOTE_AS2 117 #define NOTEFECE2C333de3 NOTE_D3 147 #define NOTE_DS3 156 #define NOTE_E3 165 #define NOTE_F3 175 #define NOTE_FS3 185 #define NOTE_G3 196 #de NOTEINGES3 208 #deinine NOTE_A3 220 #devetine NOTE_AS3 233 #deinine Notepine44444444444444 # #define NOTE_DS4 311 #devetine NOTE_E4 330 #deine NOTE_F4 349 #de NOTINE NOTE_FS4 370 #deinein NOTE_G4 392 #de NOTINE NOTE_GS4 415 #devetine NOTE_A4 440 #deFine NOTE_AS4 466 #deinEFF444444 #de4ine N. OTE_DS5 622 #devetine NOTE_E5 659 #devetine NOTE_F5 698 #de NOTINE NOTE_FS5 740 #de NOTINE NOTE_G5 784 #deFINE NOTE_GS5 831 #deFINE NOTE_A5 880 #deFINE NOTE_AS5 932 #de NOTINE_B5 988 NOTEFFINE6_6 #define NOTE_E6 1319 #devetine NOTE_F6 1397 #devetine NOTE_FS6 1480 #de NOTINE NOTE_G6 1568 #deinine NOTE_GS6 1661 #de NOTINE NOTE_A6 1760 #DEFINE NOTE_AS6 1865 #deFine NOTE_B6 1976 #Fine NOTEFINE7DEFINE7C77997 NOTE_E7 2637 #define NOTE_F7 2794 #devetine NOTE_FS7 2960 #deine NOTE_G7 3136 #de NOTINE NOTE_GS7 3322 #de NOTINE NOTE_A7 3520 #devetine NOTE_AS7 3729 #deinine NOTE_B7 3951 #devetine NOTE_C8 4186E88EEFE_EFF_478888888
// Shirin bola O mina-Guns N Roses ---------------------------------------- -------------------------------------------------- ------------------------------------- // Eslatmalar int mainRiffD = {NOTE_D4, NOTE_D5, NOTE_A4, NOTE_G4, NOTE_G5, NOTE_A4, NOTE_FS5, NOTE_A4}; int mainRiffE = {NOTE_E4, NOTE_D5, NOTE_A4, NOTE_G4, NOTE_G5, NOTE_A4, NOTE_FS5, NOTE_A4}; int mainRiffG = {NOTE_G4, NOTE_D5, NOTE_A4, NOTE_G4, NOTE_G5, NOTE_A4, NOTE_FS5, NOTE_A4};
int mainRiffDurations = {// d4 d5 a4 g4 g5 g4 fs5 a4 6, 6, 6, 6, 6, 6, 6, 6};
// Buzzer int buzzer = 4;
// ------------------------------------------------ --------------------------------------- int conta = 0;
void setup () {Serial.begin (9600); pinMod (2, Kirish); pinMode (3, INPUT); pinMode (signal, OUTPUT); lcd.begin (16, 2);
}
// ------------------------------------------------ -------------------- bekor SweetChildOMine () {uchun (int introTwoTimes = 0; introTwoTimes <2; introTwoTimes ++) {uchun (int dTwice = 0; dTwice <2; dTwice ++) {for (int thisNote = 0; thisNote <8; thisNote ++) {int mainRiffDuration = 1000/mainRiffDurations [thisNote]; ohang (buzzer, mainRiffD [thisNote], mainRiffDuration); int pauseBetweenNotes = mainRiffDuration * 1.30; kechikish (pauseBetweenNotes); noTone (ovozli signal); }} uchun (int eTwice = 0; eTwice <2; eTwice ++) {uchun (int thisNote = 0; thisNote <8; thisNote ++) {int mainRiffDuration = 1000/mainRiffDurations [thisNote]; ohang (buzzer, mainRiffE [thisNote], mainRiffDuration); int pauseBetweenNotes = mainRiffDuration * 1.30; kechikish (pauseBetweenNotes); noTone (ovozli signal); }} uchun (int gTwice = 0; gTwice <2; gTwice ++) {uchun (int thisNote = 0; thisNote <8; thisNote ++) {int mainRiffDuration = 1000/mainRiffDurations [thisNote]; ohang (buzzer, mainRiffG [thisNote], mainRiffDuration); int pauseBetweenNotes = mainRiffDuration * 1.30; kechikish (pauseBetweenNotes); noTone (ovozli signal); }} uchun (int dTwice = 0; dTwice <2; dTwice ++) {uchun (int thisNote = 0; thisNote <8; thisNote ++) {int mainRiffDuration = 1000/mainRiffDurations [thisNote]; ohang (buzzer, mainRiffD [thisNote], mainRiffDuration);
int pauseBetweenNotes = mainRiffDuration * 1.30; kechikish (pauseBetweenNotes); noTone (ovozli signal); }}}}
// TAXTLAR O'YINI--------------------------------------------- - void GameOfThrones () {for (int i = 0; i <4; i ++) {ohang (buzzer, NOTE_G4); kechikish (500); noTone (ovozli signal);
ohang (buzzer, NOTE_C4); kechikish (500); noTone (ovozli signal);
ohang (buzzer, NOTE_DS4); kechikish (250); noTone (ovozli signal);
ohang (buzzer, NOTE_F4); kechikish (250); noTone (ovozli signal); }
uchun (int i = 0; i <4; i ++) {ohang (buzzer, NOTE_G4); kechikish (500); noTone (ovozli signal);
ohang (buzzer, NOTE_C4); kechikish (500); noTone (ovozli signal);
ohang (buzzer, NOTE_E4); kechikish (250); noTone (ovozli signal);
ohang (buzzer, NOTE_F4); kechikish (250); noTone (ovozli signal);
}
ohang (buzzer, NOTE_G4); kechikish (1500); noTone (ovozli signal);
ohang (buzzer, NOTE_C4); kechikish (1500);
// ohang (buzzer, NOTE_E4); kechikish (250);
ohang (buzzer, NOTE_F4); kechikish (250);
// ohang (buzzer, NOTE_G4); kechikish (1000); noTone (ovozli signal);
ohang (buzzer, NOTE_C4); kechikish (1000);
ohang (buzzer, NOTE_DS4); kechikish (250); noTone (ovozli signal);
ohang (buzzer, NOTE_F4); kechikish (250); noTone (ovozli signal); uchun (int i = 0; i <3; i ++) {ohang (buzzer, NOTE_D4); kechikish (500);
ohang (buzzer, NOTE_G3); kechikish (500); noTone (ovozli signal);
ohang (buzzer, NOTE_AS3); kechikish (250); noTone (ovozli signal);
ohang (buzzer, NOTE_C4); kechikish (250); noTone (ovozli signal);
}
ohang (buzzer, NOTE_D4); kechikish (1500); noTone (ovozli signal); ohang (buzzer, NOTE_F4); kechikish (1500); noTone (ovozli signal);
ohang (buzzer, NOTE_AS3); kechikish (1000); noTone (ovozli signal);
ohang (buzzer, NOTE_DS4); kechikish (250); noTone (ovozli signal);
ohang (buzzer, NOTE_D4); kechikish (250); noTone (ovozli signal);
ohang (buzzer, NOTE_F4); kechikish (1000); noTone (ovozli signal);
ohang (buzzer, NOTE_AS3); kechikish (1000); noTone (ovozli signal);
ohang (buzzer, NOTE_DS4); kechikish (250); noTone (ovozli signal);
ohang (buzzer, NOTE_D4); kechikish (250); noTone (ovozli signal);
ohang (buzzer, NOTE_C4); kechikish (500); noTone (ovozli signal);
uchun (int i = 0; i <3; i ++) {ohang (buzzer, NOTE_GS3); kechikish (250); noTone (ovozli signal);
ohang (buzzer, NOTE_AS3); kechikish (250); noTone (ovozli signal);
ohang (buzzer, NOTE_C4); kechikish (500); noTone (ovozli signal); ohang (buzzer, NOTE_F3); kechikish (500); noTone (ovozli signal); }
ohang (buzzer, NOTE_G4); kechikish (1000); noTone (ovozli signal);
ohang (buzzer, NOTE_C4); kechikish (1000); noTone (ovozli signal);
ohang (buzzer, NOTE_DS4); kechikish (250); noTone (ovozli signal);
ohang (buzzer, NOTE_F4); kechikish (250); noTone (ovozli signal);
ohang (buzzer, NOTE_G4); kechikish (1000); noTone (ovozli signal);
ohang (buzzer, NOTE_C4); kechikish (1000); noTone (ovozli signal);
ohang (buzzer, NOTE_DS4); kechikish (250); noTone (ovozli signal);
ohang (buzzer, NOTE_F4); kechikish (250); noTone (ovozli signal);
ohang (buzzer, NOTE_D4); kechikish (500); noTone (ovozli signal);
uchun (int i = 0; i <4; i ++) {ohang (buzzer, NOTE_G3); kechikish (500); noTone (ovozli signal);
ohang (buzzer, NOTE_AS3); kechikish (250); noTone (ovozli signal);
ohang (buzzer, NOTE_C4); kechikish (250); noTone (ovozli signal);
ohang (buzzer, NOTE_D4); kechikish (500); noTone (ovozli signal);
} }
void loop () {{if (digitalRead (2) == HIGH) {if (digitalRead (2) == LOW) {conta ++; Serial.println (konta); lcd.print ("Qurol va Roses"); lcd.setCursor (0, 1); lcd.print ("Sweetchild OMine"); Mening shirin bolajonim(); lcd.clear (); // Borra la pantalla kechikishi (100); // Apartholita pantolon 1,5 marta. kechikish (100); }}}
{if (digitalRead (3) == HIGH) {if (digitalRead (3) == LOW) {konta--; Serial.println (konta); lcd.print ("TAKTLAR O'YINI"); lcd.setCursor (0, 1); lcd.print ("SaberQ CancionEs"); Taxtlar o'yini(); lcd.clear (); // Borra la pantalla kechikishi (100); // Apartholita pantolon 1,5 marta.
kechikish (100); }}}
}