{"id":1561,"date":"2021-09-14T14:02:48","date_gmt":"2021-09-14T05:02:48","guid":{"rendered":"http:\/\/leenux.kr\/?p=1561"},"modified":"2021-09-14T14:02:48","modified_gmt":"2021-09-14T05:02:48","slug":"arduino-%eb%b6%80%ec%a0%80-%ec%86%8c%eb%a6%ac-%ec%bc%9c%ea%b8%b0-%eb%81%84%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/leenux.kr\/?p=1561","title":{"rendered":"[Arduino] \ubd80\uc800 \uc18c\ub9ac \ucf1c\uae30\/\ub044\uae30"},"content":{"rendered":"\n<hr class=\"wp-block-separator is-style-wide\"\/>\n\n\n\n<p class=\"has-text-color has-medium-font-size has-very-dark-gray-color\"><strong>\ubd80\uc800\ub294 \ud53c\uc5d0\uc870 \ud6a8\uacfc\ub97c \uc774\uc6a9\ud558\uc5ec \uc18c\ub9ac\ub97c \ub0b4\ub294 \uc791\uc740 \uc2a4\ud53c\ucee4\uc774\ub2e4.<br>\ubd80\uc800 \uc13c\uc11c\ub294 \uc6b0\ub9ac\uc758 \uc77c\uc0c1\uc0dd\ud65c\uc5d0\uc11c \uad11\ubc94\uc704\ud558\uac8c \uc0ac\uc6a9\ub418\uace0 \uc788\uc73c\uba70, \uac04\ub2e8\ud55c \uc804\uc790\uc81c\ud488\uc5d0\uc11c \ub760\ub760 \uac70\ub9ac\ub294 \uc18c\ub9ac\ub294 \uac70\uc758 \uc774 \ubd80\uc800\ub97c \uc774\uc6a9\ud588\ub2e4\uace0 \uc0dd\uac01\ud574\ub3c4\ub41c\ub2e4.<br><br>\ud53c\uc5d0\uc870 \ubd80\uc800\ub294 (+)\uadf9\uacfc (-)\uadf9\uc744 \uac00\uc9c0\uace0 \uc788\uc73c\uba70, (+)\uadf9\uc740 \uc704\uc5d0 +\ud45c\uc2dc\uac00 \ub418\uc5b4 \uc788\ub2e4.<br>\ud53c\uc5d0\uc870 \ubd80\uc800\ub294 \ub2a5\ub3d9\ubd80\uc800\uc640 \uc218\ub3d9\ubd80\uc800\ub85c \ub098\ub258\ub294\ub370 \ubd80\uc800\uc5d0 \uadf8\ub0e5 \uc804\uae30\ub97c \uacf5\uae09\ud558\uc600\uc744 \ub54c \uc18c\ub9ac\uac00 \ub098\uba74 \ub2a5\ub3d9\ubd80\uc800, \uc804\uae30\ub97c \uacf5\uae09\ud558\uc5ec\ub3c4 \uc18c\ub9ac\uac00 \ub098\uc9c0 \uc54a\uc73c\uba74 \uc218\ub3d9\ubd80\uc800\uc774\ub2e4.<br><br>\uc218\ub3d9\ubd80\uc800\ub97c \uc774\uc6a9\ud560 \ub54c \uac01 \uc74c\uacc4\uc5d0 \ub9de\ub294 \uc8fc\ud30c\uc218(\uc9c4\ub3d9\uc218)\ub294 \uc544\ub798 \ud45c\uc640 \uac19\uc2b5\ub2c8\ub2e4.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/mblogthumb-phinf.pstatic.net\/MjAxOTA1MjlfMjIx\/MDAxNTU5MTMwNjU4MzE3.jfKFSY-TfTMgZWdELlx0sJZjxwtY3W6ONaY6Q_D7eAMg.5vkMQIBUs_3j7RjyuyDii9X60KE1s7FEr_FjIi0d9bwg.PNG.geniusus\/PIC9728.PNG?type=w800\" alt=\"\"\/><\/figure>\n\n\n\n<hr class=\"wp-block-separator is-style-wide\"\/>\n\n\n\n<p class=\"has-text-color has-large-font-size has-very-dark-gray-color\"><strong>Code<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>int speakerPin = 8;\n\n \n\nint numTones = 8;\n\nint tones[] = {261, 277, 294, 311, 330, 349, 370, 392};\n\n \n\nvoid setup() {\n\n}\n\n \n\nvoid loop() {\n\n  for(int i = 0; i &lt; numTones; i++)\n\n  {\n\n    tone(speakerPin, tones[i]);\n\n    delay(500);\n\n  }\n\n  noTone(speakerPin);\n\n  delay(1000);\n\n}<\/code><\/pre>\n\n\n\n<p class=\"has-text-color has-medium-font-size has-very-dark-gray-color\"><strong>\uacf0\uc138\ub9c8\ub9ac \ub178\ub798 <\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#define NOTE_C5  523    \/\/\ub3c4\n#define NOTE_D5  587    \/\/\ub808\n#define NOTE_E5  659    \/\/\ubbf8\n#define NOTE_F5  698    \/\/\ud30c\n#define NOTE_G5  784   \/\/\uc194\n#define NOTE_A5  880   \/\/\ub77c\n#define NOTE_B5  988   \/\/\uc2dc\n#define NOTE_C6  1047 \/\/\ub3c4\n\nint buzzerPin = 13; \nint numTones = 13;\n\nint melody[] = {\nNOTE_C5,NOTE_C5,NOTE_C5,NOTE_C5,NOTE_C5,\nNOTE_E5,NOTE_G5,NOTE_G5,NOTE_E5,NOTE_C5,\nNOTE_G5,NOTE_G5,NOTE_E5,NOTE_G5,NOTE_G5,NOTE_E5,\nNOTE_C5,NOTE_C5,NOTE_C5,\n\nNOTE_G5,NOTE_G5,NOTE_E5,NOTE_C5,\nNOTE_G5,NOTE_G5,NOTE_G5,\nNOTE_G5,NOTE_G5,NOTE_E5,NOTE_C5,\nNOTE_G5,NOTE_G5,NOTE_G5,\n\nNOTE_G5,NOTE_G5,NOTE_E5,NOTE_C5,\nNOTE_G5,NOTE_G5,NOTE_G5,NOTE_A5,NOTE_G5,\nNOTE_C6,NOTE_G5,NOTE_C6,NOTE_G5,\nNOTE_E5,NOTE_D5,NOTE_C5\n};\n\nint noteDurations[]={\n4,8,8,4,4,\n4,8,8,4,4,\n8,8,4,8,8,4,\n4,4,2,\n4,4,4,4,\n4,4,2,\n4,4,4,4,\n4,4,2,\n4,4,4,4,\n8,8,8,8,2,\n4,4,4,4,\n4,4,2\n};\n\n\nvoid setup() { \n} \nvoid loop() {\n  for (int i = 0; i &lt; 49; i++) {\n    \n    int Durations = 1000\/noteDurations[i];    \/\/ \uc74c\uacc4\uc758 \uc74c\uae38\uc774 \uacc4\uc0b0\n    tone(buzzerPin, melody[i], Durations);    \n    int pauseBetweenNotes = Durations *1.3 ;\n    delay(1000);\n    noTone(buzzerPin);\n  }\n\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>[Arduino] \ubd80\uc800 \uc18c\ub9ac \ucf1c\uae30\/\ub044\uae30 \uc608\uc81c<\/p>\n","protected":false},"author":1,"featured_media":1553,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[95],"tags":[],"_links":{"self":[{"href":"https:\/\/leenux.kr\/index.php?rest_route=\/wp\/v2\/posts\/1561"}],"collection":[{"href":"https:\/\/leenux.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/leenux.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/leenux.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/leenux.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1561"}],"version-history":[{"count":1,"href":"https:\/\/leenux.kr\/index.php?rest_route=\/wp\/v2\/posts\/1561\/revisions"}],"predecessor-version":[{"id":1562,"href":"https:\/\/leenux.kr\/index.php?rest_route=\/wp\/v2\/posts\/1561\/revisions\/1562"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/leenux.kr\/index.php?rest_route=\/wp\/v2\/media\/1553"}],"wp:attachment":[{"href":"https:\/\/leenux.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1561"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/leenux.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1561"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/leenux.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1561"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}