{"id":826,"date":"2024-06-13T08:49:03","date_gmt":"2024-06-13T08:49:03","guid":{"rendered":"https:\/\/andreitupits23.thkit.ee\/WP\/?page_id=826"},"modified":"2024-06-13T12:52:55","modified_gmt":"2024-06-13T12:52:55","slug":"ulesanne-6","status":"publish","type":"page","link":"https:\/\/andreitupits23.thkit.ee\/WP\/ulesanne-6\/","title":{"rendered":"Ulesanne 6"},"content":{"rendered":"\n<div class=\"wp-block-group alignfull has-background-background-color has-background\" style=\"margin-top:0;margin-bottom:0;padding-top:var(--wp--preset--spacing--60);padding-right:var(--wp--preset--spacing--30);padding-bottom:var(--wp--preset--spacing--60);padding-left:var(--wp--preset--spacing--30)\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-container-core-group-is-layout-392eb801 wp-block-group-is-layout-constrained\">\n<p>Buzzer<\/p>\n\n\n\n<p><mark><strong>T\u00f6\u00f6kirjeldus<\/strong><\/mark><\/p>\n\n\n\n<p>Programm sisaldab kahte re\u017eiimi: Esimene re\u017eiim on \u201cklaver\u201d, mis l\u00fclitub automaatselt sisse p\u00e4rast voolu sissel\u00fclitamist. Selles re\u017eiimis t\u00f6\u00f6tavad k\u00f5ik neli nuppu ja piesoelektriline element. Esimesed kolm nuppu vastutavad kindla noodi m\u00e4ngimise eest piesoelektroonika abil, mis on v\u00f5rreldav klaveri t\u00f6\u00f6ga. Selles re\u017eiimis ilmuvad LCD-ekraanile nootide pildid ja m\u00e4ngitava noodi nimetus. Neljas nupp l\u00fclitab re\u017eiimi \u00fcmber.<\/p>\n\n\n\n<p>Teine re\u017eiim hakkab sissel\u00fclitamisel m\u00e4ngima meloodiat, mille nimi kuvatakse LCD-ekraanil. Kokku on salvestatud kolm meloodiat, mille vahel saab esimese nupuga vahetada. Neljas nupp l\u00fclitab re\u017eiimi tagasi \u201cklaveri\u201d re\u017eiimi.<\/p>\n\n\n\n<p><mark><strong>Komponendid<\/strong><\/mark><\/p>\n\n\n\n<p>Takisti (220\u03a9) \u2013 5<br>Nupp \u2013 5<br>Piesoelektroonika \u2013 1<br>LCD 16 x 2 \u2013 1<br>Arduino Uno R3 \u2013 1<br>V\u00e4ike protot\u00fc\u00fcpplaat \u2013 1<\/p>\n\n\n\n<p><mark><strong>Kasutamine<\/strong><\/mark><\/p>\n\n\n\n<p><strong>M\u00e4nguasjad ja muusikaseadmed<\/strong>: Muusikalised m\u00e4nguasjad ja seadmed lastele kasutavad sageli piesosummereid meloodiate ja helide esitamiseks.<\/p>\n\n\n\n<p><strong>\u00c4ratuskellad ja taimerid<\/strong>: \u00c4ratuskellades ja k\u00f6\u00f6gitaimerites kasutatakse sageli piesosummereid helisignaali andmiseks.<\/p>\n\n\n\n<p><strong>Signalisatsioon ja teavitamine<\/strong>: Signalisatsioonis\u00fcsteemides, turva- ja tulekahjus\u00fcsteemides kasutatakse piesosummereid h\u00e4iresignaali andmiseks.<\/p>\n\n\n\n<p><strong>Elektroonikaseadmed ja vidinad<\/strong>: Paljud elektroonikaseadmed, nagu mobiiltelefonid, arvutid ja kodumasinad, kasutavad piesosummereid s\u00fcndmuste v\u00f5i toimingute heliteavitamiseks.<\/p>\n\n\n\n<p><strong>Muusikalised postkaardid<\/strong>: Muusikalistes postkaartides kasutatakse sageli piesosummereid l\u00fchikeste meloodiate esitamiseks kaardi avamisel.<\/p>\n\n\n\n<p><strong>Haridusprojektid ja isetehtud elektroonika<\/strong>: \u00d5ppeprojektides ja isetehtud projektides, mis p\u00f5hinevad n\u00e4iteks Arduino ja teistel mikrokontrollerite platvormidel, kasutatakse piesosummereid sageli helide ja meloodiate genereerimise eksperimentides.<\/p>\n\n\n\n<p><strong><mark>Kood<\/mark><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;LiquidCrystal.h&gt;\nconst int rs = 12, e = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2; \nLiquidCrystal lcd(rs, e, d4, d5, d6, d7);\n \nint switch_button = 1;\nint switch_mode = 0;\n \nbyte deathnote&#91;8] = {0b00011,0b00010,0b00010,0b00010,0b01110,0b10010,0b10010,0b01100};\n#define ACTIVATED LOW\n \n\/\/\u041d\u043e\u0442\u044b\n#define NOTE_B0  31 \/\/\u0432\u044b\u0441\u043e\u0442\u0430 \u043d\u043e\u0442\u044b \u0432 \u0433\u0435\u0440\u0446\u0430\u0445\n#define NOTE_C1  33\n#define NOTE_CS1 35\n#define NOTE_D1  37\n#define NOTE_DS1 39\n#define NOTE_E1  41\n#define NOTE_F1  44\n#define NOTE_FS1 46\n#define NOTE_G1  49\n#define NOTE_GS1 52\n#define NOTE_A1  55\n#define NOTE_AS1 58\n#define NOTE_B1  62\n#define NOTE_C2  65\n#define NOTE_CS2 69\n#define NOTE_D2  73\n#define NOTE_DS2 78\n#define NOTE_E2  82\n#define NOTE_F2  87\n#define NOTE_FS2 93\n#define NOTE_G2  98\n#define NOTE_GS2 104\n#define NOTE_A2  110\n#define NOTE_AS2 117\n#define NOTE_B2  123\n#define NOTE_C3  131\n#define NOTE_CS3 139\n#define NOTE_D3  147\n#define NOTE_DS3 156\n#define NOTE_E3  165\n#define NOTE_F3  175\n#define NOTE_FS3 185\n#define NOTE_G3  196\n#define NOTE_GS3 208\n#define NOTE_A3  220\n#define NOTE_AS3 233\n#define NOTE_B3  247\n#define NOTE_C4  262\n#define NOTE_CS4 277\n#define NOTE_D4  294\n#define NOTE_DS4 311\n#define NOTE_E4  330\n#define NOTE_F4  349\n#define NOTE_FS4 370\n#define NOTE_G4  392\n#define NOTE_GS4 415\n#define NOTE_A4  440\n#define NOTE_AS4 466\n#define NOTE_B4  494\n#define NOTE_C5  523\n#define NOTE_CS5 554\n#define NOTE_D5  587\n#define NOTE_DS5 622\n#define NOTE_E5  659\n#define NOTE_F5  698\n#define NOTE_FS5 740\n#define NOTE_G5  784\n#define NOTE_GS5 831\n#define NOTE_A5  880\n#define NOTE_AS5 932\n#define NOTE_B5  988\n#define NOTE_C6  1047\n#define NOTE_CS6 1109\n#define NOTE_D6  1175\n#define NOTE_DS6 1245\n#define NOTE_E6  1319\n#define NOTE_F6  1397\n#define NOTE_FS6 1480\n#define NOTE_G6  1568\n#define NOTE_GS6 1661\n#define NOTE_A6  1760\n#define NOTE_AS6 1865\n#define NOTE_B6  1976\n#define NOTE_C7  2093\n#define NOTE_CS7 2217\n#define NOTE_D7  2349\n#define NOTE_DS7 2489\n#define NOTE_E7  2637\n#define NOTE_F7  2794\n#define NOTE_FS7 2960\n#define NOTE_G7  3136\n#define NOTE_GS7 3322\n#define NOTE_A7  3520\n#define NOTE_AS7 3729\n#define NOTE_B7  3951\n#define NOTE_C8  4186\n#define NOTE_CS8 4435\n#define NOTE_D8  4699\n#define NOTE_DS8 4978\n#define REST      0\n \n#define buzzer    1 \/\/ \u043f\u0438\u043d \u0441 \u043f\u0438\u0449\u0430\u043b\u043a\u043e\u0439 \n#define BUTTON10_PIN 10\n#define BUTTON9_PIN 9\n#define BUTTON8_PIN 8\n#define BUTTON7_PIN 7\n \n\/\/\u041c\u0435\u043b\u043e\u0434\u0438\u044f doom\nconst int melody&#91;] PROGMEM = {\n  NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_C3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_AS2, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_B2, 8, NOTE_C3, 8,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_C3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_AS2, -2,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_C3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_AS2, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_B2, 8, NOTE_C3, 8,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_C3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_AS2, -2,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_C3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_AS2, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_B2, 8, NOTE_C3, 8,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_C3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_AS2, -2,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_C3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_AS2, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_B2, 8, NOTE_C3, 8,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_FS3, -16, NOTE_D3, -16, NOTE_B2, -16, NOTE_A3, -16, NOTE_FS3, -16, NOTE_B2, -16, NOTE_D3, -16, NOTE_FS3, -16, NOTE_A3, -16, NOTE_FS3, -16, NOTE_D3, -16, NOTE_B2, -16,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_C3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_AS2, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_B2, 8, NOTE_C3, 8,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_C3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_AS2, -2,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_C3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_AS2, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_B2, 8, NOTE_C3, 8,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_B3, -16, NOTE_G3, -16, NOTE_E3, -16, NOTE_G3, -16, NOTE_B3, -16, NOTE_E4, -16, NOTE_G3, -16, NOTE_B3, -16, NOTE_E4, -16, NOTE_B3, -16, NOTE_G4, -16, NOTE_B4, -16,NOTE_A2, 8, NOTE_A2, 8, NOTE_A3, 8, NOTE_A2, 8, NOTE_A2, 8, NOTE_G3, 8, NOTE_A2, 8, NOTE_A2, 8,NOTE_F3, 8, NOTE_A2, 8, NOTE_A2, 8, NOTE_DS3, 8, NOTE_A2, 8, NOTE_A2, 8, NOTE_E3, 8, NOTE_F3, 8,NOTE_A2, 8, NOTE_A2, 8, NOTE_A3, 8, NOTE_A2, 8, NOTE_A2, 8, NOTE_G3, 8, NOTE_A2, 8, NOTE_A2, 8,NOTE_F3, 8, NOTE_A2, 8, NOTE_A2, 8, NOTE_DS3, -2,NOTE_A2, 8, NOTE_A2, 8, NOTE_A3, 8, NOTE_A2, 8, NOTE_A2, 8, NOTE_G3, 8, NOTE_A2, 8, NOTE_A2, 8,NOTE_F3, 8, NOTE_A2, 8, NOTE_A2, 8, NOTE_DS3, 8, NOTE_A2, 8, NOTE_A2, 8, NOTE_E3, 8, NOTE_F3, 8,NOTE_A2, 8, NOTE_A2, 8, NOTE_A3, 8, NOTE_A2, 8, NOTE_A2, 8, NOTE_G3, 8, NOTE_A2, 8, NOTE_A2, 8,NOTE_A3, -16, NOTE_F3, -16, NOTE_D3, -16, NOTE_A3, -16, NOTE_F3, -16, NOTE_D3, -16, NOTE_C4, -16, NOTE_A3, -16, NOTE_F3, -16, NOTE_A3, -16, NOTE_F3, -16, NOTE_D3, -16,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_C3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_AS2, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_B2, 8, NOTE_C3, 8,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_C3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_AS2, -2,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_C3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_AS2, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_B2, 8, NOTE_C3, 8,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_C3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_AS2, -2,NOTE_CS3, 8, NOTE_CS3, 8, NOTE_CS4, 8, NOTE_CS3, 8, NOTE_CS3, 8, NOTE_B3, 8, NOTE_CS3, 8, NOTE_CS3, 8,NOTE_A3, 8, NOTE_CS3, 8, NOTE_CS3, 8, NOTE_G3, 8, NOTE_CS3, 8, NOTE_CS3, 8, NOTE_GS3, 8, NOTE_A3, 8,NOTE_B2, 8, NOTE_B2, 8, NOTE_B3, 8, NOTE_B2, 8, NOTE_B2, 8, NOTE_A3, 8, NOTE_B2, 8, NOTE_B2, 8,NOTE_G3, 8, NOTE_B2, 8, NOTE_B2, 8, NOTE_F3, -2,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_C3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_AS2, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_B2, 8, NOTE_C3, 8,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_B3, -16, NOTE_G3, -16, NOTE_E3, -16, NOTE_G3, -16, NOTE_B3, -16, NOTE_E4, -16, NOTE_G3, -16, NOTE_B3, -16, NOTE_E4, -16, NOTE_B3, -16, NOTE_G4, -16, NOTE_B4, -16,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_C3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_AS2, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_B2, 8, NOTE_C3, 8,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_C3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_AS2, -2,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_C3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_AS2, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_B2, 8, NOTE_C3, 8,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_FS3, -16, NOTE_DS3, -16, NOTE_B2, -16, NOTE_FS3, -16, NOTE_DS3, -16, NOTE_B2, -16, NOTE_G3, -16, NOTE_D3, -16, NOTE_B2, -16, NOTE_DS4, -16, NOTE_DS3, -16, NOTE_B2, -16,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_C3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_AS2, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_B2, 8, NOTE_C3, 8,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_C3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_AS2, -2,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_C3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_AS2, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_B2, 8, NOTE_C3, 8,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_E4, -16, NOTE_B3, -16, NOTE_G3, -16, NOTE_G4, -16, NOTE_E4, -16, NOTE_G3, -16, NOTE_B3, -16, NOTE_D4, -16, NOTE_E4, -16, NOTE_G4, -16, NOTE_E4, -16, NOTE_G3, -16,  NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_C3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_AS2, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_B2, 8, NOTE_C3, 8,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_C3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_AS2, -2,NOTE_A2, 8, NOTE_A2, 8, NOTE_A3, 8, NOTE_A2, 8, NOTE_A2, 8, NOTE_G3, 8, NOTE_A2, 8, NOTE_A2, 8,NOTE_F3, 8, NOTE_A2, 8, NOTE_A2, 8, NOTE_DS3, 8, NOTE_A2, 8, NOTE_A2, 8, NOTE_E3, 8, NOTE_F3, 8,NOTE_A2, 8, NOTE_A2, 8, NOTE_A3, 8, NOTE_A2, 8, NOTE_A2, 8, NOTE_G3, 8, NOTE_A2, 8, NOTE_A2, 8,NOTE_A3, -16, NOTE_F3, -16, NOTE_D3, -16, NOTE_A3, -16, NOTE_F3, -16, NOTE_D3, -16, NOTE_C4, -16, NOTE_A3, -16, NOTE_F3, -16, NOTE_A3, -16, NOTE_F3, -16, NOTE_D3, -16,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_C3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_AS2, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_B2, 8, NOTE_C3, 8,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_C3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_AS2, -2,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_C3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_AS2, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_B2, 8, NOTE_C3, 8,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_C3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_AS2, -2,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_C3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_AS2, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_B2, 8, NOTE_C3, 8,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_C3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_AS2, -2,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_C3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_AS2, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_B2, 8, NOTE_C3, 8,NOTE_E2, 8, NOTE_E2, 8, NOTE_E3, 8, NOTE_E2, 8, NOTE_E2, 8, NOTE_D3, 8, NOTE_E2, 8, NOTE_E2, 8,NOTE_B3, -16, NOTE_G3, -16, NOTE_E3, -16, NOTE_B2, -16, NOTE_E3, -16, NOTE_G3, -16, NOTE_C4, -16, NOTE_B3, -16, NOTE_G3, -16, NOTE_B3, -16, NOTE_G3, -16, NOTE_E3, -16,  \n};\n \n\/\/ Fur Elise - Ludwig van Beethovem\nconst int melody_2&#91;] PROGMEM = {   \n  NOTE_E5, 16, NOTE_DS5, 16, NOTE_E5, 16, NOTE_DS5, 16, NOTE_E5, 16, NOTE_B4, 16, NOTE_D5, 16, NOTE_C5, 16,NOTE_A4, -8, NOTE_C4, 16, NOTE_E4, 16, NOTE_A4, 16,NOTE_B4, -8, NOTE_E4, 16, NOTE_GS4, 16, NOTE_B4, 16,NOTE_C5, 8,  REST, 16, NOTE_E4, 16, NOTE_E5, 16,  NOTE_DS5, 16,NOTE_E5, 16, NOTE_DS5, 16, NOTE_E5, 16, NOTE_B4, 16, NOTE_D5, 16, NOTE_C5, 16,NOTE_A4, -8, NOTE_C4, 16, NOTE_E4, 16, NOTE_A4, 16, NOTE_B4, -8, NOTE_E4, 16, NOTE_C5, 16, NOTE_B4, 16, NOTE_A4 , 4, REST, 8,NOTE_E5, 16, NOTE_DS5, 16, NOTE_E5, 16, NOTE_DS5, 16, NOTE_E5, 16, NOTE_B4, 16, NOTE_D5, 16, NOTE_C5, 16,NOTE_A4, -8, NOTE_C4, 16, NOTE_E4, 16, NOTE_A4, 16,NOTE_B4, -8, NOTE_E4, 16, NOTE_GS4, 16, NOTE_B4, 16,NOTE_C5, 8,  REST, 16, NOTE_E4, 16, NOTE_E5, 16,  NOTE_DS5, 16, NOTE_E5, 16, NOTE_DS5, 16, NOTE_E5, 16, NOTE_B4, 16, NOTE_D5, 16, NOTE_C5, 16,NOTE_A4, -8, NOTE_C4, 16, NOTE_E4, 16, NOTE_A4, 16, NOTE_B4, -8, NOTE_E4, 16, NOTE_C5, 16, NOTE_B4, 16, NOTE_A4, 8, REST, 16, NOTE_B4, 16, NOTE_C5, 16, NOTE_D5, 16,NOTE_E5, -8, NOTE_G4, 16, NOTE_F5, 16, NOTE_E5, 16, NOTE_D5, -8, NOTE_F4, 16, NOTE_E5, 16, NOTE_D5, 16,NOTE_C5, -8, NOTE_E4, 16, NOTE_D5, 16, NOTE_C5, 16,NOTE_B4, 8, REST, 16, NOTE_E4, 16, NOTE_E5, 16, REST, 16,REST, 16, NOTE_E5, 16, NOTE_E6, 16, REST, 16, REST, 16, NOTE_DS5, 16,NOTE_E5, 16, REST, 16, REST, 16, NOTE_DS5, 16, NOTE_E5, 16, NOTE_DS5, 16,NOTE_E5, 16, NOTE_DS5, 16, NOTE_E5, 16, NOTE_B4, 16, NOTE_D5, 16, NOTE_C5, 16,NOTE_A4, 8, REST, 16, NOTE_C4, 16, NOTE_E4, 16, NOTE_A4, 16,NOTE_B4, 8, REST, 16, NOTE_E4, 16, NOTE_GS4, 16, NOTE_B4, 16,NOTE_C5, 8, REST, 16, NOTE_E4, 16, NOTE_E5, 16,  NOTE_DS5, 16,NOTE_E5, 16, NOTE_DS5, 16, NOTE_E5, 16, NOTE_B4, 16, NOTE_D5, 16, NOTE_C5, 16,NOTE_A4, 8, REST, 16, NOTE_C4, 16, NOTE_E4, 16, NOTE_A4, 16,NOTE_B4, 8, REST, 16, NOTE_E4, 16, NOTE_C5, 16, NOTE_B4, 16,NOTE_A4, 8, REST, 16, NOTE_B4, 16, NOTE_C5, 16, NOTE_D5, 16,NOTE_E5, -8, NOTE_G4, 16, NOTE_F5, 16, NOTE_E5, 16, NOTE_D5, -8, NOTE_F4, 16, NOTE_E5, 16, NOTE_D5, 16,NOTE_C5, -8, NOTE_E4, 16, NOTE_D5, 16, NOTE_C5, 16,NOTE_B4, 8, REST, 16, NOTE_E4, 16, NOTE_E5, 16, REST, 16,REST, 16, NOTE_E5, 16, NOTE_E6, 16, REST, 16, REST, 16, NOTE_DS5, 16,NOTE_E5, 16, REST, 16, REST, 16, NOTE_DS5, 16, NOTE_E5, 16, NOTE_DS5, 16,NOTE_E5, 16, NOTE_DS5, 16, NOTE_E5, 16, NOTE_B4, 16, NOTE_D5, 16, NOTE_C5, 16,NOTE_A4, 8, REST, 16, NOTE_C4, 16, NOTE_E4, 16, NOTE_A4, 16,NOTE_B4, 8, REST, 16, NOTE_E4, 16, NOTE_GS4, 16, NOTE_B4, 16,NOTE_C5, 8, REST, 16, NOTE_E4, 16, NOTE_E5, 16,  NOTE_DS5, 16,NOTE_E5, 16, NOTE_DS5, 16, NOTE_E5, 16, NOTE_B4, 16, NOTE_D5, 16, NOTE_C5, 16,NOTE_A4, 8, REST, 16, NOTE_C4, 16, NOTE_E4, 16, NOTE_A4, 16,NOTE_B4, 8, REST, 16, NOTE_E4, 16, NOTE_C5, 16, NOTE_B4, 16,NOTE_A4, 8, REST, 16, NOTE_C5, 16, NOTE_C5, 16, NOTE_C5, 16,NOTE_C5 , 4, NOTE_F5, -16, NOTE_E5, 32, NOTE_E5, 8, NOTE_D5, 8, NOTE_AS5, -16, NOTE_A5, 32,NOTE_A5, 16, NOTE_G5, 16, NOTE_F5, 16, NOTE_E5, 16, NOTE_D5, 16, NOTE_C5, 16,NOTE_AS4, 8, NOTE_A4, 8, NOTE_A4, 32, NOTE_G4, 32, NOTE_A4, 32, NOTE_B4, 32,NOTE_C5 , 4, NOTE_D5, 16, NOTE_DS5, 16,NOTE_E5, -8, NOTE_E5, 16, NOTE_F5, 16, NOTE_A4, 16,NOTE_C5 , 4,  NOTE_D5, -16, NOTE_B4, 32,  NOTE_C5, 32, NOTE_G5, 32, NOTE_G4, 32, NOTE_G5, 32, NOTE_A4, 32, NOTE_G5, 32, NOTE_B4, 32, NOTE_G5, 32, NOTE_C5, 32, NOTE_G5, 32, NOTE_D5, 32, NOTE_G5, 32,NOTE_E5, 32, NOTE_G5, 32, NOTE_C6, 32, NOTE_B5, 32, NOTE_A5, 32, NOTE_G5, 32, NOTE_F5, 32, NOTE_E5, 32, NOTE_D5, 32, NOTE_G5, 32, NOTE_F5, 32, NOTE_D5, 32,NOTE_C5, 32, NOTE_G5, 32, NOTE_G4, 32, NOTE_G5, 32, NOTE_A4, 32, NOTE_G5, 32, NOTE_B4, 32, NOTE_G5, 32, NOTE_C5, 32, NOTE_G5, 32, NOTE_D5, 32, NOTE_G5, 32,NOTE_E5, 32, NOTE_G5, 32, NOTE_C6, 32, NOTE_B5, 32, NOTE_A5, 32, NOTE_G5, 32, NOTE_F5, 32, NOTE_E5, 32, NOTE_D5, 32, NOTE_G5, 32, NOTE_F5, 32, NOTE_D5, 32,NOTE_E5, 32, NOTE_F5, 32, NOTE_E5, 32, NOTE_DS5, 32, NOTE_E5, 32, NOTE_B4, 32, NOTE_E5, 32, NOTE_DS5, 32, NOTE_E5, 32, NOTE_B4, 32, NOTE_E5, 32, NOTE_DS5, 32,NOTE_E5, -8, NOTE_B4, 16, NOTE_E5, 16, NOTE_DS5, 16,NOTE_E5, -8, NOTE_B4, 16, NOTE_E5, 16, REST, 16,REST, 16, NOTE_DS5, 16, NOTE_E5, 16, REST, 16, REST, 16, NOTE_DS5, 16,NOTE_E5, 16, NOTE_DS5, 16, NOTE_E5, 16, NOTE_B4, 16, NOTE_D5, 16, NOTE_C5, 16,NOTE_A4, 8, REST, 16, NOTE_C4, 16, NOTE_E4, 16, NOTE_A4, 16,NOTE_B4, 8, REST, 16, NOTE_E4, 16, NOTE_GS4, 16, NOTE_B4, 16,NOTE_C5, 8, REST, 16, NOTE_E4, 16, NOTE_E5, 16, NOTE_DS5, 16,NOTE_E5, 16, NOTE_DS5, 16, NOTE_E5, 16, NOTE_B4, 16, NOTE_D5, 16, NOTE_C5, 16,NOTE_A4, 8, REST, 16, NOTE_C4, 16, NOTE_E4, 16, NOTE_A4, 16,NOTE_B4, 8, REST, 16, NOTE_E4, 16, NOTE_C5, 16, NOTE_B4, 16,NOTE_A4, 8, REST, 16, NOTE_B4, 16, NOTE_C5, 16, NOTE_D5, 16,NOTE_E5, -8, NOTE_G4, 16, NOTE_F5, 16, NOTE_E5, 16,NOTE_D5, -8, NOTE_F4, 16, NOTE_E5, 16, NOTE_D5, 16,NOTE_C5, -8, NOTE_E4, 16, NOTE_D5, 16, NOTE_C5, 16,NOTE_B4, 8, REST, 16, NOTE_E4, 16, NOTE_E5, 16, REST, 16,REST, 16, NOTE_E5, 16, NOTE_E6, 16, REST, 16, REST, 16, NOTE_DS5, 16,NOTE_E5, 16, REST, 16, REST, 16, NOTE_DS5, 16, NOTE_E5, 16, NOTE_D5, 16,NOTE_E5, 16, NOTE_DS5, 16, NOTE_E5, 16, NOTE_B4, 16, NOTE_D5, 16, NOTE_C5, 16,NOTE_A4, 8, REST, 16, NOTE_C4, 16, NOTE_E4, 16, NOTE_A4, 16,NOTE_B4, 8, REST, 16, NOTE_E4, 16, NOTE_GS4, 16, NOTE_B4, 16,NOTE_C5, 8, REST, 16, NOTE_E4, 16, NOTE_E5, 16, NOTE_DS5, 16,NOTE_E5, 16, NOTE_DS5, 16, NOTE_E5, 16, NOTE_B4, 16, NOTE_D5, 16, NOTE_C5, 16,NOTE_A4, 8, REST, 16, NOTE_C4, 16, NOTE_E4, 16, NOTE_A4, 16,NOTE_B4, 8, REST, 16, NOTE_E4, 16, NOTE_C5, 16, NOTE_B4, 16,NOTE_A4, 8, REST, 16, REST, 16, REST, 8, NOTE_CS5 , -4, NOTE_D5 , 4, NOTE_E5, 16, NOTE_F5, 16,NOTE_F5 , 4, NOTE_F5, 8, NOTE_E5 , -4,NOTE_D5 , 4, NOTE_C5, 16, NOTE_B4, 16,NOTE_A4 , 4, NOTE_A4, 8,NOTE_A4, 8, NOTE_C5, 8, NOTE_B4, 8,NOTE_A4 , -4,NOTE_CS5 , -4,NOTE_D5 , 4, NOTE_E5, 16, NOTE_F5, 16,NOTE_F5 , 4, NOTE_F5, 8,NOTE_F5 , -4,NOTE_DS5 , 4, NOTE_D5, 16, NOTE_C5, 16,NOTE_AS4 , 4, NOTE_A4, 8,NOTE_GS4 , 4, NOTE_G4, 8,NOTE_A4 , -4,NOTE_B4 , 4, REST, 8,NOTE_A3, -32, NOTE_C4, -32, NOTE_E4, -32, NOTE_A4, -32, NOTE_C5, -32, NOTE_E5, -32, NOTE_D5, -32, NOTE_C5, -32, NOTE_B4, -32,NOTE_A4, -32, NOTE_C5, -32, NOTE_E5, -32, NOTE_A5, -32, NOTE_C6, -32, NOTE_E6, -32, NOTE_D6, -32, NOTE_C6, -32, NOTE_B5, -32,NOTE_A4, -32, NOTE_C5, -32, NOTE_E5, -32, NOTE_A5, -32, NOTE_C6, -32, NOTE_E6, -32, NOTE_D6, -32, NOTE_C6, -32, NOTE_B5, -32,NOTE_AS5, -32, NOTE_A5, -32, NOTE_GS5, -32, NOTE_G5, -32, NOTE_FS5, -32, NOTE_F5, -32, NOTE_E5, -32, NOTE_DS5, -32, NOTE_D5, -32,NOTE_CS5, -32, NOTE_C5, -32, NOTE_B4, -32, NOTE_AS4, -32, NOTE_A4, -32, NOTE_GS4, -32, NOTE_G4, -32, NOTE_FS4, -32, NOTE_F4, -32,NOTE_E4, 16, NOTE_DS5, 16, NOTE_E5, 16, NOTE_B4, 16, NOTE_D5, 16, NOTE_C5, 16,NOTE_A4, -8, NOTE_C4, 16, NOTE_E4, 16, NOTE_A4, 16,NOTE_B4, -8, NOTE_E4, 16, NOTE_GS4, 16, NOTE_B4, 16,NOTE_C5, 8, REST, 16, NOTE_E4, 16, NOTE_E5, 16, NOTE_DS5, 16,NOTE_E5, 16, NOTE_DS5, 16, NOTE_E5, 16, NOTE_B4, 16, NOTE_D5, 16, NOTE_C5, 16, NOTE_A4, -8, NOTE_C4, 16, NOTE_E4, 16, NOTE_A4, 16, NOTE_B4, -8, NOTE_E4, 16, NOTE_C5, 16, NOTE_B4, 16, NOTE_A4, -8, REST, -8,REST, -8, NOTE_G4, 16, NOTE_F5, 16, NOTE_E5, 16,NOTE_D5 , 4, REST, 8,REST, -8, NOTE_E4, 16, NOTE_D5, 16, NOTE_C5, 16,NOTE_B4, -8, NOTE_E4, 16, NOTE_E5, 8,NOTE_E5, 8, NOTE_E6, -8, NOTE_DS5, 16,NOTE_E5, 16, REST, 16, REST, 16, NOTE_DS5, 16, NOTE_E5, 16, NOTE_DS5, 16,NOTE_E5, 16, NOTE_DS5, 16, NOTE_E5, 16, NOTE_B4, 16, NOTE_D5, 16, NOTE_C5, 16,NOTE_A4, -8, NOTE_C4, 16, NOTE_E4, 16, NOTE_A4, 16,NOTE_B4, -8, NOTE_E4, 16, NOTE_GS4, 16, NOTE_B4, 16,NOTE_C5, 8, REST, 16, NOTE_E4, 16, NOTE_E5, 16, NOTE_DS5, 16,NOTE_E5, 16, NOTE_DS5, 16, NOTE_E5, 16, NOTE_B4, 16, NOTE_D5, 16, NOTE_C5, 16,NOTE_A4, -8, NOTE_C4, 16, NOTE_E4, 16, NOTE_A4, 16,NOTE_B4, -8, NOTE_E4, 16, NOTE_C5, 16, NOTE_B4, 16,NOTE_A4 , -4,\n};\n \n\/\/Take on me - a-ha\nint melody_3&#91;] = {\n  NOTE_FS5,8, NOTE_FS5,8,NOTE_D5,8, NOTE_B4,8, REST,8, NOTE_B4,8, REST,8, NOTE_E5,8, REST,8, NOTE_E5,8, REST,8, NOTE_E5,8, NOTE_GS5,8, NOTE_GS5,8, NOTE_A5,8, NOTE_B5,8,NOTE_A5,8, NOTE_A5,8, NOTE_A5,8, NOTE_E5,8, REST,8, NOTE_D5,8, REST,8, NOTE_FS5,8, REST,8, NOTE_FS5,8, REST,8, NOTE_FS5,8, NOTE_E5,8, NOTE_E5,8, NOTE_FS5,8, NOTE_E5,8,NOTE_FS5,8, NOTE_FS5,8,NOTE_D5,8, NOTE_B4,8, REST,8, NOTE_B4,8, REST,8, NOTE_E5,8, REST,8, NOTE_E5,8, REST,8, NOTE_E5,8, NOTE_GS5,8, NOTE_GS5,8, NOTE_A5,8, NOTE_B5,8,NOTE_A5,8, NOTE_A5,8, NOTE_A5,8, NOTE_E5,8, REST,8, NOTE_D5,8, REST,8, NOTE_FS5,8, REST,8, NOTE_FS5,8, REST,8, NOTE_FS5,8, NOTE_E5,8, NOTE_E5,8, NOTE_FS5,8, NOTE_E5,8,NOTE_FS5,8, NOTE_FS5,8,NOTE_D5,8, NOTE_B4,8, REST,8, NOTE_B4,8, REST,8, NOTE_E5,8, REST,8, NOTE_E5,8, REST,8, NOTE_E5,8, NOTE_GS5,8, NOTE_GS5,8, NOTE_A5,8, NOTE_B5,8,NOTE_A5,8, NOTE_A5,8, NOTE_A5,8, NOTE_E5,8, REST,8, NOTE_D5,8, REST,8, NOTE_FS5,8, REST,8, NOTE_FS5,8, REST,8, NOTE_FS5,8, NOTE_E5,8, NOTE_E5,8, NOTE_FS5,8, NOTE_E5,8,  \n};\n \nint tempo = 225;\nint tempo_2 = 80;\nconst int tempo_3 = 140;\n \nint notes = sizeof(melody) \/ sizeof(melody&#91;0]) \/ 2;\nint wholenote = (60000 * 4) \/ tempo;\nint divider = 0, noteDuration = 0;\n \nint notes_2 = sizeof(melody_2) \/ sizeof(melody_2&#91;0]) \/ 2;\nint wholenote_2 = (60000 * 4) \/ tempo_2;\n \nint notes_3 = sizeof(melody_3) \/ sizeof(melody_3&#91;0]) \/ 2;\nint wholenote_3 = (60000 * 4) \/ tempo_3;\n \nvoid setup()\n{\n  pinMode(buzzer, OUTPUT);\n  lcd.createChar(1, deathnote);\n}\n \nvoid loop()\n{\n  lcd.begin(16, 2);\n \n  if(switch_mode == 0)\n  {\n    for(int i = 0; i&lt;8; i=i+2)\n    {\n      lcd.setCursor(i,0);\n      lcd.write(1);\n      lcd.setCursor(i,1);\n      lcd.write(1);\n    }\n    for(int y = 9; y&lt;16; y=y+2)\n    {\n      lcd.setCursor(y,0);\n      lcd.write(1);\n      lcd.setCursor(y,1);\n      lcd.write(1);\n    }\n    while(digitalRead(BUTTON7_PIN) == ACTIVATED)\n    {\n      tone(buzzer,NOTE_G3);\n      lcd_write_note(\"G3\");\n    }\n    while(digitalRead(BUTTON8_PIN) == ACTIVATED)\n    {\n      tone(buzzer,NOTE_C4);\n      lcd_write_note(\"C4\");\n    }\n    while(digitalRead(BUTTON9_PIN) == ACTIVATED)\n    {\n      tone(buzzer,NOTE_F4);\n      lcd_write_note(\"F4\");\n    }\n    noTone(buzzer);\n    if(digitalRead(BUTTON10_PIN) == LOW)\n    {\n      Switch_mode();\n    }\n  }\n     \n  else if(switch_mode == 1)\n  {\n    \n    if(switch_button == 1)\n    {\n       \n      lcd.print(\"Doom OST. - E1M1\");\n      note_write_song();\n      for (int thisNote = 0; thisNote &lt; notes * 2; thisNote = thisNote + 2)\n      {\n        divider = pgm_read_word_near(melody+thisNote + 1);\n        if (divider &gt; 0) \n        {\n          noteDuration = (wholenote) \/ divider;\n        } \n        else if (divider &lt; 0) \n        {\n          noteDuration = (wholenote) \/ abs(divider);\n          noteDuration *= 1.5;\n        }\n        tone(buzzer, pgm_read_word_near(melody+thisNote), noteDuration * 0.9);\n        delay(noteDuration);\n        noTone(buzzer);\n        if(digitalRead(BUTTON10_PIN) == LOW)\n        {\n          Switch_mode();\n          break;\n        }\n \n        if (digitalRead(BUTTON7_PIN) == LOW) \n        {\n          switch_button = 0;\n          break;\n        }\n      }\n    }\n    else if (switch_button == 0)\n    {\n      lcd.setCursor(2,0);\n      lcd.print(\"Beethoven -\");\n      lcd.setCursor(3,1);\n      lcd.print(\"Fur Elise\");\n      note_write_song();\n      for (int thisNote = 0; thisNote &lt; notes_2 * 2; thisNote = thisNote + 2) \n      {\n        divider = pgm_read_word_near(melody_2+thisNote + 1);\n        if (divider &gt; 0) \n        {\n          noteDuration = (wholenote_2) \/ divider;\n        } \n        else if (divider &lt; 0) \n        {\n          noteDuration = (wholenote_2) \/ abs(divider);\n          noteDuration *= 1.5;\n        }\n \n        tone(buzzer, pgm_read_word_near(melody_2+thisNote), noteDuration * 0.9);\n        delay(noteDuration);\n        noTone(buzzer);\n          if(digitalRead(BUTTON10_PIN) == LOW)\n          {\n            Switch_mode();\n            break;\n          }\n          if (digitalRead(BUTTON7_PIN) == LOW) \n          {\n            switch_button = 2;\n            break;\n          }\n      }\n \n      }\n    else if (switch_button == 2)\n    {\n      lcd.setCursor(6,0);\n      lcd.print(\"a-ha\");\n      lcd.setCursor(3,1);\n      lcd.print(\"Take On Me\");\n      note_write_song();\n      for (int thisNote = 0; thisNote &lt; notes_3 * 2; thisNote = thisNote + 2) \n      {\n        divider = melody_3&#91;thisNote + 1];\n        if (divider &gt; 0) \n        {\n          noteDuration = (wholenote_3) \/ divider;\n        } \n        else if (divider &lt; 0) \n        {\n          noteDuration = (wholenote_3) \/ abs(divider);\n          noteDuration *= 1.5; \n        }\n \n        tone(buzzer, melody_3&#91;thisNote], noteDuration * 0.9);\n        delay(noteDuration);\n        noTone(buzzer);\n        if(digitalRead(BUTTON10_PIN) == LOW)\n        {\n          Switch_mode();\n          break;\n        }\n        if (digitalRead(BUTTON7_PIN) == LOW) \n        {\n          switch_button = 1;\n          break;\n        }\n      }\n    }   \n  }\n}\n \nvoid Switch_mode()\n{\n  if(digitalRead(BUTTON10_PIN) == LOW)\n  {\n    if(switch_mode == 0)\n    {\n      switch_mode = 1;\n    }\n    else if(switch_mode == 1)\n    {\n      switch_mode = 0;\n    }\n  }\n}\nvoid note_write_song()\n{\n  lcd.setCursor(0,1);\n  lcd.write(1);\n  lcd.setCursor(15,1);\n  lcd.write(1);\n}\nvoid lcd_write_note(const char* note)\n{\n  lcd.setCursor(7,0);\n  lcd.print(note);\n}<\/code><\/pre>\n\n\n\n<p><mark><strong>Link<\/strong><\/mark><\/p>\n\n\n\n<p><a href=\"https:\/\/youtube.com\/shorts\/5MP04jHUSr8rE?feature=share\">https:\/\/youtube.com\/shorts\/5MP04jHUSr8rE?feature=share<\/a><\/p>\n\n\n\n<p><mark><strong>Konstruktsioon Tinkercad<\/strong><\/mark><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"609\" src=\"https:\/\/andreitupits23.thkit.ee\/WP\/wp-content\/uploads\/2024\/06\/image-2-1024x609.png\" alt=\"\" class=\"wp-image-829\" srcset=\"https:\/\/andreitupits23.thkit.ee\/WP\/wp-content\/uploads\/2024\/06\/image-2-1024x609.png 1024w, https:\/\/andreitupits23.thkit.ee\/WP\/wp-content\/uploads\/2024\/06\/image-2-300x179.png 300w, https:\/\/andreitupits23.thkit.ee\/WP\/wp-content\/uploads\/2024\/06\/image-2-768x457.png 768w, https:\/\/andreitupits23.thkit.ee\/WP\/wp-content\/uploads\/2024\/06\/image-2-750x446.png 750w, https:\/\/andreitupits23.thkit.ee\/WP\/wp-content\/uploads\/2024\/06\/image-2.png 1240w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Buzzer T\u00f6\u00f6kirjeldus Programm sisaldab kahte re\u017eiimi: Esimene re\u017eiim on \u201cklaver\u201d, mis l\u00fclitub automaatselt sisse p\u00e4rast voolu sissel\u00fclitamist. Selles re\u017eiimis t\u00f6\u00f6tavad k\u00f5ik neli nuppu ja piesoelektriline element. Esimesed kolm nuppu vastutavad kindla noodi m\u00e4ngimise eest piesoelektroonika abil, mis on v\u00f5rreldav klaveri t\u00f6\u00f6ga. Selles re\u017eiimis ilmuvad LCD-ekraanile nootide pildid ja m\u00e4ngitava noodi nimetus. Neljas nupp l\u00fclitab re\u017eiimi<a class=\"more-link\" href=\"https:\/\/andreitupits23.thkit.ee\/WP\/ulesanne-6\/\">Continue reading <span class=\"screen-reader-text\">&#8220;Ulesanne 6&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-826","page","type-page","status-publish","hentry","entry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Ulesanne 6 - \/ &Otilde;pimapp \/ Portfoolio<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/andreitupits23.thkit.ee\/WP\/ulesanne-6\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ulesanne 6 - \/ &Otilde;pimapp \/ Portfoolio\" \/>\n<meta property=\"og:description\" content=\"Buzzer T\u00f6\u00f6kirjeldus Programm sisaldab kahte re\u017eiimi: Esimene re\u017eiim on \u201cklaver\u201d, mis l\u00fclitub automaatselt sisse p\u00e4rast voolu sissel\u00fclitamist. Selles re\u017eiimis t\u00f6\u00f6tavad k\u00f5ik neli nuppu ja piesoelektriline element. Esimesed kolm nuppu vastutavad kindla noodi m\u00e4ngimise eest piesoelektroonika abil, mis on v\u00f5rreldav klaveri t\u00f6\u00f6ga. Selles re\u017eiimis ilmuvad LCD-ekraanile nootide pildid ja m\u00e4ngitava noodi nimetus. Neljas nupp l\u00fclitab re\u017eiimiContinue reading &quot;Ulesanne 6&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/andreitupits23.thkit.ee\/WP\/ulesanne-6\/\" \/>\n<meta property=\"og:site_name\" content=\"\/ &Otilde;pimapp \/ Portfoolio\" \/>\n<meta property=\"article:modified_time\" content=\"2024-06-13T12:52:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/andreitupits23.thkit.ee\/WP\/wp-content\/uploads\/2024\/06\/image-2-1024x609.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/andreitupits23.thkit.ee\\\/WP\\\/ulesanne-6\\\/\",\"url\":\"https:\\\/\\\/andreitupits23.thkit.ee\\\/WP\\\/ulesanne-6\\\/\",\"name\":\"Ulesanne 6 - \\\/ &Otilde;pimapp \\\/ Portfoolio\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/andreitupits23.thkit.ee\\\/WP\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/andreitupits23.thkit.ee\\\/WP\\\/ulesanne-6\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/andreitupits23.thkit.ee\\\/WP\\\/ulesanne-6\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/andreitupits23.thkit.ee\\\/WP\\\/wp-content\\\/uploads\\\/2024\\\/06\\\/image-2-1024x609.png\",\"datePublished\":\"2024-06-13T08:49:03+00:00\",\"dateModified\":\"2024-06-13T12:52:55+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/andreitupits23.thkit.ee\\\/WP\\\/ulesanne-6\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/andreitupits23.thkit.ee\\\/WP\\\/ulesanne-6\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/andreitupits23.thkit.ee\\\/WP\\\/ulesanne-6\\\/#primaryimage\",\"url\":\"https:\\\/\\\/andreitupits23.thkit.ee\\\/WP\\\/wp-content\\\/uploads\\\/2024\\\/06\\\/image-2.png\",\"contentUrl\":\"https:\\\/\\\/andreitupits23.thkit.ee\\\/WP\\\/wp-content\\\/uploads\\\/2024\\\/06\\\/image-2.png\",\"width\":1240,\"height\":738},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/andreitupits23.thkit.ee\\\/WP\\\/ulesanne-6\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/andreitupits23.thkit.ee\\\/WP\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Ulesanne 6\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/andreitupits23.thkit.ee\\\/WP\\\/#website\",\"url\":\"https:\\\/\\\/andreitupits23.thkit.ee\\\/WP\\\/\",\"name\":\"\\\/ &Otilde;pimapp \\\/ Portfoolio\",\"description\":\"Welcome to my WP page.\",\"publisher\":{\"@id\":\"https:\\\/\\\/andreitupits23.thkit.ee\\\/WP\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/andreitupits23.thkit.ee\\\/WP\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/andreitupits23.thkit.ee\\\/WP\\\/#organization\",\"name\":\"\\\/ &Otilde;pimapp \\\/ Portfoolio\",\"url\":\"https:\\\/\\\/andreitupits23.thkit.ee\\\/WP\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/andreitupits23.thkit.ee\\\/WP\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/andreitupits23.thkit.ee\\\/WP\\\/wp-content\\\/uploads\\\/2024\\\/03\\\/cropped-logo.png\",\"contentUrl\":\"https:\\\/\\\/andreitupits23.thkit.ee\\\/WP\\\/wp-content\\\/uploads\\\/2024\\\/03\\\/cropped-logo.png\",\"width\":240,\"height\":240,\"caption\":\"\\\/ &Otilde;pimapp \\\/ Portfoolio\"},\"image\":{\"@id\":\"https:\\\/\\\/andreitupits23.thkit.ee\\\/WP\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Ulesanne 6 - \/ &Otilde;pimapp \/ Portfoolio","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/andreitupits23.thkit.ee\/WP\/ulesanne-6\/","og_locale":"en_GB","og_type":"article","og_title":"Ulesanne 6 - \/ &Otilde;pimapp \/ Portfoolio","og_description":"Buzzer T\u00f6\u00f6kirjeldus Programm sisaldab kahte re\u017eiimi: Esimene re\u017eiim on \u201cklaver\u201d, mis l\u00fclitub automaatselt sisse p\u00e4rast voolu sissel\u00fclitamist. Selles re\u017eiimis t\u00f6\u00f6tavad k\u00f5ik neli nuppu ja piesoelektriline element. Esimesed kolm nuppu vastutavad kindla noodi m\u00e4ngimise eest piesoelektroonika abil, mis on v\u00f5rreldav klaveri t\u00f6\u00f6ga. Selles re\u017eiimis ilmuvad LCD-ekraanile nootide pildid ja m\u00e4ngitava noodi nimetus. Neljas nupp l\u00fclitab re\u017eiimiContinue reading \"Ulesanne 6\"","og_url":"https:\/\/andreitupits23.thkit.ee\/WP\/ulesanne-6\/","og_site_name":"\/ &Otilde;pimapp \/ Portfoolio","article_modified_time":"2024-06-13T12:52:55+00:00","og_image":[{"url":"https:\/\/andreitupits23.thkit.ee\/WP\/wp-content\/uploads\/2024\/06\/image-2-1024x609.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Estimated reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/andreitupits23.thkit.ee\/WP\/ulesanne-6\/","url":"https:\/\/andreitupits23.thkit.ee\/WP\/ulesanne-6\/","name":"Ulesanne 6 - \/ &Otilde;pimapp \/ Portfoolio","isPartOf":{"@id":"https:\/\/andreitupits23.thkit.ee\/WP\/#website"},"primaryImageOfPage":{"@id":"https:\/\/andreitupits23.thkit.ee\/WP\/ulesanne-6\/#primaryimage"},"image":{"@id":"https:\/\/andreitupits23.thkit.ee\/WP\/ulesanne-6\/#primaryimage"},"thumbnailUrl":"https:\/\/andreitupits23.thkit.ee\/WP\/wp-content\/uploads\/2024\/06\/image-2-1024x609.png","datePublished":"2024-06-13T08:49:03+00:00","dateModified":"2024-06-13T12:52:55+00:00","breadcrumb":{"@id":"https:\/\/andreitupits23.thkit.ee\/WP\/ulesanne-6\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/andreitupits23.thkit.ee\/WP\/ulesanne-6\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/andreitupits23.thkit.ee\/WP\/ulesanne-6\/#primaryimage","url":"https:\/\/andreitupits23.thkit.ee\/WP\/wp-content\/uploads\/2024\/06\/image-2.png","contentUrl":"https:\/\/andreitupits23.thkit.ee\/WP\/wp-content\/uploads\/2024\/06\/image-2.png","width":1240,"height":738},{"@type":"BreadcrumbList","@id":"https:\/\/andreitupits23.thkit.ee\/WP\/ulesanne-6\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/andreitupits23.thkit.ee\/WP\/"},{"@type":"ListItem","position":2,"name":"Ulesanne 6"}]},{"@type":"WebSite","@id":"https:\/\/andreitupits23.thkit.ee\/WP\/#website","url":"https:\/\/andreitupits23.thkit.ee\/WP\/","name":"\/ &Otilde;pimapp \/ Portfoolio","description":"Welcome to my WP page.","publisher":{"@id":"https:\/\/andreitupits23.thkit.ee\/WP\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/andreitupits23.thkit.ee\/WP\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/andreitupits23.thkit.ee\/WP\/#organization","name":"\/ &Otilde;pimapp \/ Portfoolio","url":"https:\/\/andreitupits23.thkit.ee\/WP\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/andreitupits23.thkit.ee\/WP\/#\/schema\/logo\/image\/","url":"https:\/\/andreitupits23.thkit.ee\/WP\/wp-content\/uploads\/2024\/03\/cropped-logo.png","contentUrl":"https:\/\/andreitupits23.thkit.ee\/WP\/wp-content\/uploads\/2024\/03\/cropped-logo.png","width":240,"height":240,"caption":"\/ &Otilde;pimapp \/ Portfoolio"},"image":{"@id":"https:\/\/andreitupits23.thkit.ee\/WP\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/andreitupits23.thkit.ee\/WP\/wp-json\/wp\/v2\/pages\/826","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/andreitupits23.thkit.ee\/WP\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/andreitupits23.thkit.ee\/WP\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/andreitupits23.thkit.ee\/WP\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/andreitupits23.thkit.ee\/WP\/wp-json\/wp\/v2\/comments?post=826"}],"version-history":[{"count":5,"href":"https:\/\/andreitupits23.thkit.ee\/WP\/wp-json\/wp\/v2\/pages\/826\/revisions"}],"predecessor-version":[{"id":835,"href":"https:\/\/andreitupits23.thkit.ee\/WP\/wp-json\/wp\/v2\/pages\/826\/revisions\/835"}],"wp:attachment":[{"href":"https:\/\/andreitupits23.thkit.ee\/WP\/wp-json\/wp\/v2\/media?parent=826"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}