{"id":77756,"date":"2020-04-23T09:15:33","date_gmt":"2020-04-23T03:15:33","guid":{"rendered":"http:\/\/rcl-radio.ru\/?p=77756"},"modified":"2022-01-08T18:43:23","modified_gmt":"2022-01-08T12:43:23","slug":"%d0%b8%d0%ba-%d0%bf%d1%83%d0%bb%d1%8c%d1%82-%d0%b8%d0%b7-arduino","status":"publish","type":"post","link":"http:\/\/rcl-radio.ru\/?p=77756","title":{"rendered":"\u0418\u041a \u043f\u0443\u043b\u044c\u0442 \u0438\u0437 Arduino"},"content":{"rendered":"<p>\u041f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0418\u041a \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u0430 \u043d\u0430 \u0431\u0430\u0437\u0435 Arduino \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0418\u041a \u043f\u0443\u043b\u044c\u0442. \u0422\u0430\u043a\u043e\u0439 \u0418\u041a \u043f\u0443\u043b\u044c\u0442 \u043c\u043e\u0436\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u043e\u0439 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0443\u0441\u0442-\u0432 \u0438\u043c\u0435\u044e\u0449\u0438\u0445 \u0418\u041a \u043f\u0440\u0438\u0435\u043c\u043d\u0438\u043a. \u041d\u0430 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043a\u043e\u043c\u0430\u043d\u0434 \u0441 \u043e\u0434\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u044b Arduino \u043a \u0434\u0440\u0443\u0433\u043e\u0439. \u041a \u043f\u043b\u0430\u0442\u0435 Arduino \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043e\u0442 \u0418\u041a \u0434\u0438\u043e\u0434\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u0418\u041a- \u043f\u0440\u0438\u0435\u043c\u043d\u0438\u043a, \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0418\u041a \u043f\u0443\u043b\u044c\u0442\u0430 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430\u043c\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0435\u043b\u0435).<\/p>\n<p><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/04\/Screenshot-23.04.2020-091248.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-77761\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/04\/Screenshot-23.04.2020-091248.png\" alt=\"\" width=\"385\" height=\"211\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/04\/Screenshot-23.04.2020-091248.png 385w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/04\/Screenshot-23.04.2020-091248-200x110.png 200w\" sizes=\"auto, (max-width: 385px) 100vw, 385px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/04\/Screenshot-23.04.2020-085430.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-77757\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/04\/Screenshot-23.04.2020-085430.png\" alt=\"\" width=\"554\" height=\"353\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/04\/Screenshot-23.04.2020-085430.png 554w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/04\/Screenshot-23.04.2020-085430-200x127.png 200w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/04\/Screenshot-23.04.2020-085430-500x319.png 500w\" sizes=\"auto, (max-width: 554px) 100vw, 554px\" \/><\/a><\/p>\n<p>\u0421\u043e\u0431\u0435\u0440\u0438\u0442\u0435 \u0441\u0445\u0435\u043c\u0443 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0441\u043a\u0435\u0442\u0447.<\/p>\n<div id=\"marketWidget\"><\/div>\n<pre class=\"actionscript\" style=\"font-family: monospace; font-size: 10px;\"><span style=\"color: #808080; font-style: italic;\">#include &lt;IRremote.h&gt; \/\/ http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/06\/IRremote.zip<\/span>\r\n<span style=\"color: #808080; font-style: italic;\">#include &lt;boarddefs.h&gt;<\/span>\r\n  IRsend irr;\r\n\u00a0\r\n<span style=\"color: #0066cc;\">void<\/span> setup<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>\r\n  Serial.<span style=\"color: #006600;\">begin<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">9600<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n  irr.<span style=\"color: #006600;\">enableIROut<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">38<\/span><span style=\"color: #66cc66;\">)<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ 38 kHz out D9<\/span>\r\n  pinMode<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">2<\/span>,INPUT<span style=\"color: #66cc66;\">)<\/span>;\r\n  pinMode<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">3<\/span>,INPUT<span style=\"color: #66cc66;\">)<\/span>;\r\n  pinMode<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">4<\/span>,INPUT<span style=\"color: #66cc66;\">)<\/span>;\r\n  pinMode<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">5<\/span>,INPUT<span style=\"color: #66cc66;\">)<\/span>;\r\n<span style=\"color: #66cc66;\">}<\/span>\r\n\u00a0\r\n<span style=\"color: #0066cc;\">void<\/span> loop<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span> <span style=\"color: #66cc66;\">{<\/span>\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>digitalRead<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">2<\/span><span style=\"color: #66cc66;\">)<\/span>==HIGH<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>irr.<span style=\"color: #006600;\">sendNEC<\/span><span style=\"color: #66cc66;\">(<\/span>0x1A001134, <span style=\"color: #cc66cc;\">32<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span>\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>digitalRead<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">3<\/span><span style=\"color: #66cc66;\">)<\/span>==HIGH<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>irr.<span style=\"color: #006600;\">sendNEC<\/span><span style=\"color: #66cc66;\">(<\/span>0x2A004516, <span style=\"color: #cc66cc;\">32<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span>\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>digitalRead<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">4<\/span><span style=\"color: #66cc66;\">)<\/span>==HIGH<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>irr.<span style=\"color: #006600;\">sendNEC<\/span><span style=\"color: #66cc66;\">(<\/span>0x3A006780, <span style=\"color: #cc66cc;\">32<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span>\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>digitalRead<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">5<\/span><span style=\"color: #66cc66;\">)<\/span>==HIGH<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>irr.<span style=\"color: #006600;\">sendNEC<\/span><span style=\"color: #66cc66;\">(<\/span>0x4A001122, <span style=\"color: #cc66cc;\">32<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span>\r\n  delay<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">200<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n<span style=\"color: #66cc66;\">}<\/span><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043a\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u043b\u0430\u0442\u0435 Arduino \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u043c\u043e\u0434\u0443\u043b\u044c \u0418\u041a \u043f\u0440\u0438\u0435\u043c\u043d\u0438\u043a\u0430<\/p>\n<p><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/04\/Screenshot-23.04.2020-090826.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-77760\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/04\/Screenshot-23.04.2020-090826.png\" alt=\"\" width=\"373\" height=\"265\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/04\/Screenshot-23.04.2020-090826.png 373w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/04\/Screenshot-23.04.2020-090826-200x142.png 200w\" sizes=\"auto, (max-width: 373px) 100vw, 373px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/04\/Screenshot-23.04.2020-085915.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-77758\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/04\/Screenshot-23.04.2020-085915.png\" alt=\"\" width=\"358\" height=\"233\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/04\/Screenshot-23.04.2020-085915.png 358w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/04\/Screenshot-23.04.2020-085915-200x130.png 200w\" sizes=\"auto, (max-width: 358px) 100vw, 358px\" \/><\/a><\/p>\n<p>\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0441\u043a\u0435\u0442\u0447<\/p>\n<pre class=\"actionscript\" style=\"font-family: monospace; font-size: 10px;\"><span style=\"color: #808080; font-style: italic;\">#include &lt;boarddefs.h&gt;<\/span>\r\n<span style=\"color: #808080; font-style: italic;\">#include &lt;IRremote.h&gt;<\/span>\r\nIRrecv irrecv<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">12<\/span><span style=\"color: #66cc66;\">)<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0432\u044b\u0432\u043e\u0434 \u043c\u043e\u0434\u0443\u043b\u044f IR \u043f\u0440\u0438\u0435\u043c\u043d\u0438\u043a\u0430<\/span>\r\n\u00a0\r\n  decode_results ir; \r\n\u00a0\r\n<span style=\"color: #0066cc;\">void<\/span> setup<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span> <span style=\"color: #66cc66;\">{<\/span>\r\n irrecv.<span style=\"color: #006600;\">enableIRIn<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;Serial.<span style=\"color: #006600;\">begin<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">9600<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n pinMode<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">13<\/span>,OUTPUT<span style=\"color: #66cc66;\">)<\/span>;\r\n\u00a0\r\n<span style=\"color: #66cc66;\">}<\/span>\r\n\u00a0\r\n<span style=\"color: #0066cc;\">void<\/span> loop<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span> <span style=\"color: #66cc66;\">{<\/span>\r\n  <span style=\"color: #b1b100;\">if<\/span> <span style=\"color: #66cc66;\">(<\/span> irrecv.<span style=\"color: #006600;\">decode<\/span><span style=\"color: #66cc66;\">(<\/span> <span style=\"color: #66cc66;\">&amp;<\/span>ir <span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">)<\/span> <span style=\"color: #66cc66;\">{<\/span>Serial.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #ff0000;\">\"0x\"<\/span><span style=\"color: #66cc66;\">)<\/span>;Serial.<span style=\"color: #006600;\">println<\/span><span style=\"color: #66cc66;\">(<\/span> ir.<span style=\"color: #006600;\">value<\/span>,HEX<span style=\"color: #66cc66;\">)<\/span>;irrecv.<span style=\"color: #006600;\">resume<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span><span style=\"color: #808080; font-style: italic;\">\/\/ IR \u043f\u0440\u0438\u0435\u043c\u043d\u0438\u043a - \u0447\u0442\u0435\u043d\u0438\u0435, \u0432 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0435 \u043f\u043e\u0440\u0442\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u043a\u043e\u0434\u044b \u043a\u043d\u043e\u043f\u043e\u043a<\/span>\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>ir.<span style=\"color: #006600;\">value<\/span>==0x1A001134<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>digitalWrite<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">13<\/span>,HIGH<span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span>\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>ir.<span style=\"color: #006600;\">value<\/span>==0x2A004516<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>digitalWrite<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">13<\/span>,LOW<span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span>\r\n  ir.<span style=\"color: #006600;\">value<\/span>=<span style=\"color: #cc66cc;\">0<\/span>;\r\n<span style=\"color: #66cc66;\">}<\/span><\/pre>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u043c\u043e\u043d\u0438\u0442\u043e\u0440 \u043f\u043e\u0440\u0442\u0430 \u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u043f\u043e\u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e \u043a\u043d\u043e\u043f\u043a\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0435 \u043a \u043f\u0435\u0440\u0432\u043e\u0439 \u043f\u043b\u0430\u0442\u0435 Arduino, \u0432 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0435 \u043f\u043e\u0440\u0442\u0430 \u0412\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e<\/p>\n<p><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/04\/Screenshot-23.04.2020-081536.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-77759\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/04\/Screenshot-23.04.2020-081536.png\" alt=\"\" width=\"284\" height=\"319\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/04\/Screenshot-23.04.2020-081536.png 284w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/04\/Screenshot-23.04.2020-081536-200x225.png 200w\" sizes=\"auto, (max-width: 284px) 100vw, 284px\" \/><\/a><\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u043d\u0430 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0435, \u0432 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0435 \u043f\u043e\u0440\u0442\u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u043b\u0430\u0442\u044b \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u043a\u043e\u0434\u044b \u043a\u043d\u043e\u043f\u043e\u043a \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0441\u044b\u043b\u0430\u0435\u0442 \u0418\u041a \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u0447\u0438\u043a \u0441 \u043f\u0435\u0440\u0432\u043e\u0439 \u043f\u043b\u0430\u0442\u044b Arduino. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0439 \u0432\u044b\u0445\u043e\u0434 D13 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u043b\u0430\u0442\u0435 \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434 (\u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u043f\u043b\u0430\u0442\u0435 Arduino), \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 1 (\u043f\u0435\u0440\u0432\u0430\u044f \u043f\u043b\u0430\u0442\u0430) \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434 \u0437\u0430\u0433\u043e\u0440\u0430\u0435\u0442\u0441\u044f, \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 2 \u0433\u0430\u0441\u043d\u0435\u0442.<\/p>\n<hr \/>\n<h3 style=\"text-align: center;\">\u0418\u041a \u0443\u0434\u043b\u0438\u043d\u0438\u0442\u0435\u043b\u044c<\/h3>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043b\u0430\u0442\u0435 Arduino \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0441 \u0418\u041a \u043f\u0443\u043b\u044c\u0442\u0430 \u0438 \u0442\u0443\u0436\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a \u043f\u043b\u0430\u0442\u0435 Arduino \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0418\u041a-\u0434\u0430\u0442\u0447\u0438\u043a \u0438 \u0418\u041a-\u0434\u0438\u043e\u0434.<\/p>\n<pre class=\"actionscript\" style=\"font-family: monospace; font-size: 10px;\"><span style=\"color: #808080; font-style: italic;\">#include &lt;IRremote.h&gt; \/\/ http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/06\/IRremote.zip<\/span>\r\n<span style=\"color: #808080; font-style: italic;\">#include &lt;boarddefs.h&gt;<\/span>\r\n  IRsend irr;\r\n  IRrecv irrecv<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">12<\/span><span style=\"color: #66cc66;\">)<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0432\u044b\u0432\u043e\u0434 \u043c\u043e\u0434\u0443\u043b\u044f IR \u043f\u0440\u0438\u0435\u043c\u043d\u0438\u043a\u0430<\/span>\r\n  decode_results ir; \r\n  byte w;\r\n\u00a0\r\n<span style=\"color: #0066cc;\">void<\/span> setup<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>\r\n  Serial.<span style=\"color: #006600;\">begin<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">9600<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n  irrecv.<span style=\"color: #006600;\">enableIRIn<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n  irr.<span style=\"color: #006600;\">enableIROut<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">38<\/span><span style=\"color: #66cc66;\">)<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ 38 kHz out D9<\/span>\r\n<span style=\"color: #66cc66;\">}<\/span>\r\n\u00a0\r\n<span style=\"color: #0066cc;\">void<\/span> loop<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span> <span style=\"color: #66cc66;\">{<\/span>\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span> irrecv.<span style=\"color: #006600;\">decode<\/span><span style=\"color: #66cc66;\">(<\/span> <span style=\"color: #66cc66;\">&amp;<\/span>ir <span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">)<\/span> <span style=\"color: #66cc66;\">{<\/span>Serial.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #ff0000;\">\"0x\"<\/span><span style=\"color: #66cc66;\">)<\/span>;Serial.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span> ir.<span style=\"color: #006600;\">value<\/span>,HEX<span style=\"color: #66cc66;\">)<\/span>;irrecv.<span style=\"color: #006600;\">resume<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span>\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>ir.<span style=\"color: #006600;\">value<\/span>==<span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>w=<span style=\"color: #cc66cc;\">0<\/span>;<span style=\"color: #66cc66;\">}<\/span>\r\n\u00a0\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>ir.<span style=\"color: #006600;\">value<\/span>==0x2FD00FF<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>w=<span style=\"color: #cc66cc;\">1<\/span>;ir.<span style=\"color: #006600;\">value<\/span>=<span style=\"color: #cc66cc;\">0<\/span>;irr.<span style=\"color: #006600;\">enableIROut<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">38<\/span><span style=\"color: #66cc66;\">)<\/span>;irr.<span style=\"color: #006600;\">sendNEC<\/span><span style=\"color: #66cc66;\">(<\/span>0x1A001134, <span style=\"color: #cc66cc;\">32<\/span><span style=\"color: #66cc66;\">)<\/span>;Serial.<span style=\"color: #006600;\">println<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #ff0000;\">\" code 1 \"<\/span><span style=\"color: #66cc66;\">)<\/span>;delay<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">50<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span>\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>ir.<span style=\"color: #006600;\">value<\/span>==0xFFFFFFFF <span style=\"color: #66cc66;\">&amp;&amp;<\/span> w==<span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>ir.<span style=\"color: #006600;\">value<\/span>=<span style=\"color: #cc66cc;\">0<\/span>;irr.<span style=\"color: #006600;\">enableIROut<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">38<\/span><span style=\"color: #66cc66;\">)<\/span>;irr.<span style=\"color: #006600;\">sendNEC<\/span><span style=\"color: #66cc66;\">(<\/span>0x1A001134, <span style=\"color: #cc66cc;\">32<\/span><span style=\"color: #66cc66;\">)<\/span>;Serial.<span style=\"color: #006600;\">println<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #ff0000;\">\" code 1 \"<\/span><span style=\"color: #66cc66;\">)<\/span>;delay<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">50<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span>\r\n\u00a0\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>ir.<span style=\"color: #006600;\">value<\/span>==0x2FD42BD<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>w=<span style=\"color: #cc66cc;\">2<\/span>;ir.<span style=\"color: #006600;\">value<\/span>=<span style=\"color: #cc66cc;\">0<\/span>;irr.<span style=\"color: #006600;\">enableIROut<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">38<\/span><span style=\"color: #66cc66;\">)<\/span>;irr.<span style=\"color: #006600;\">sendNEC<\/span><span style=\"color: #66cc66;\">(<\/span>0x1A001555, <span style=\"color: #cc66cc;\">32<\/span><span style=\"color: #66cc66;\">)<\/span>;Serial.<span style=\"color: #006600;\">println<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #ff0000;\">\" code 2 \"<\/span><span style=\"color: #66cc66;\">)<\/span>;delay<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">50<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span>\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>ir.<span style=\"color: #006600;\">value<\/span>==0xFFFFFFFF <span style=\"color: #66cc66;\">&amp;&amp;<\/span> w==<span style=\"color: #cc66cc;\">2<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>ir.<span style=\"color: #006600;\">value<\/span>=<span style=\"color: #cc66cc;\">0<\/span>;irr.<span style=\"color: #006600;\">enableIROut<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">38<\/span><span style=\"color: #66cc66;\">)<\/span>;irr.<span style=\"color: #006600;\">sendNEC<\/span><span style=\"color: #66cc66;\">(<\/span>0x1A001555, <span style=\"color: #cc66cc;\">32<\/span><span style=\"color: #66cc66;\">)<\/span>;Serial.<span style=\"color: #006600;\">println<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #ff0000;\">\" code 2 \"<\/span><span style=\"color: #66cc66;\">)<\/span>;delay<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">50<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span>\r\n\u00a0\r\n  irrecv.<span style=\"color: #006600;\">enableIRIn<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n  delay<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">200<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n<span style=\"color: #66cc66;\">}<\/span><\/pre>\n<p>\u0412 \u0440\u0430\u0431\u043e\u0442\u0435 \u0418\u041a-\u0443\u0434\u043b\u0438\u043d\u0438\u0442\u0435\u043b\u044f \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u0430 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c, \u0434\u0435\u043b\u043e \u0432 \u0442\u043e\u043c \u0447\u0442\u043e \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043a\u043d\u043e\u043f\u043a\u0438 \u043f\u0443\u043b\u044c\u0442\u0430 \u043a\u043e\u0434 \u043a\u043d\u043e\u043f\u043a\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 Arduino \u043d\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0435 \u0443\u0441\u0442-\u0432\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434 (\u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0435 \u043f\u043e\u0440\u0442\u0430), \u0430 \u0432\u043e\u0442 \u0443\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u043b\u044e\u0431\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0438 \u043f\u0443\u043b\u044c\u0442\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u043a\u043e\u0434 0xFFFFFFFF (\u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e), \u043a\u0430\u043a \u0440\u0430\u0437 \u044d\u0442\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0443\u0447\u0442\u0435\u043d\u0430 \u0432 \u0441\u043a\u0435\u0442\u0447\u0435. \u0421\u043a\u0435\u0442\u0447 \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0435\u0442 \u043a \u043a\u0430\u043a\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a\u043e\u0434 0xFFFFFFFF, \u0430 \u043a \u043a\u0430\u043a\u043e\u0439 \u043d\u0435\u0442.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u043a\u0435\u0442\u0447\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u043c\u043e\u043d\u0438\u0442\u043e\u0440 \u043f\u043e\u0440\u0442\u0430 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u043e\u0434\u044b \u043a\u043d\u043e\u043f\u043e\u043a \u0412\u0430\u0448\u0435\u0433\u043e \u043f\u0443\u043b\u044c\u0442\u0430, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u043f\u0438\u0441\u0430\u0442\u044c \u0438\u0445 \u0432 \u0441\u043a\u0435\u0442\u0447:<\/p>\n<p><span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>ir.<span style=\"color: #006600;\">value<\/span>==<strong>\u041a\u041e\u0414_\u041a\u041d\u041e\u041f\u041a\u0418_\u041f\u0423\u041b\u042c\u0422\u0410<\/strong><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>w=<span style=\"color: #cc66cc;\">1<\/span>;ir.<span style=\"color: #006600;\">value<\/span>=<span style=\"color: #cc66cc;\">0<\/span>;irr.<span style=\"color: #006600;\">enableIROut<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">38<\/span><span style=\"color: #66cc66;\">)<\/span>;irr.<span style=\"color: #006600;\">sendNEC<\/span><span style=\"color: #66cc66;\">(<\/span><strong>\u041a\u041e\u0414_\u041a\u041e\u0422\u041e\u0420\u042b\u0419 \u041d\u0423\u0416\u041d\u041e_\u041f\u0415\u0420\u0415\u0414\u0410\u0422\u042c<\/strong>, <span style=\"color: #cc66cc;\">32<\/span><span style=\"color: #66cc66;\">)<\/span>;Serial.<span style=\"color: #006600;\">println<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #ff0000;\">&#187; code 1 &#171;<\/span><span style=\"color: #66cc66;\">)<\/span>;delay<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">50<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span><\/p>\n<p>\u0412 \u0441\u043a\u0435\u0442\u0447\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0432\u0443\u0445 \u043a\u043d\u043e\u043f\u043e\u043a, \u043d\u043e \u0412\u044b \u043f\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u0441\u043a\u0435\u0442\u0447\u0430 \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u043a\u043e\u043b-\u0432\u043e \u043a\u043d\u043e\u043f\u043e\u043a.<\/p>\n<p><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/04\/Screenshot-24.04.2020-084845.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-77764\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/04\/Screenshot-24.04.2020-084845.png\" alt=\"\" width=\"249\" height=\"317\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/04\/Screenshot-24.04.2020-084845.png 249w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/04\/Screenshot-24.04.2020-084845-200x255.png 200w\" sizes=\"auto, (max-width: 249px) 100vw, 249px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0418\u041a \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u0430 \u043d\u0430 \u0431\u0430\u0437\u0435 Arduino \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0418\u041a \u043f\u0443\u043b\u044c\u0442. \u0422\u0430\u043a\u043e\u0439 \u0418\u041a \u043f\u0443\u043b\u044c\u0442 \u043c\u043e\u0436\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u043e\u0439 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0443\u0441\u0442-\u0432 \u0438\u043c\u0435\u044e\u0449\u0438\u0445 \u0418\u041a \u043f\u0440\u0438\u0435\u043c\u043d\u0438\u043a. \u041d\u0430 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043a\u043e\u043c\u0430\u043d\u0434 \u0441 \u043e\u0434\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u044b Arduino \u043a \u0434\u0440\u0443\u0433\u043e\u0439. \u041a \u043f\u043b\u0430\u0442\u0435 Arduino \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043e\u0442 \u0418\u041a \u0434\u0438\u043e\u0434\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u0418\u041a- \u043f\u0440\u0438\u0435\u043c\u043d\u0438\u043a, \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0418\u041a \u043f\u0443\u043b\u044c\u0442\u0430 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":77758,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[239],"tags":[],"class_list":["post-77756","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino"],"views":7299,"_links":{"self":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/77756","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=77756"}],"version-history":[{"count":6,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/77756\/revisions"}],"predecessor-version":[{"id":111256,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/77756\/revisions\/111256"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/media\/77758"}],"wp:attachment":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=77756"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=77756"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=77756"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}