{"id":68615,"date":"2019-12-23T22:58:34","date_gmt":"2019-12-23T16:58:34","guid":{"rendered":"http:\/\/rcl-radio.ru\/?p=68615"},"modified":"2022-01-09T13:10:43","modified_gmt":"2022-01-09T07:10:43","slug":"arduino-hc-06-pwm-button","status":"publish","type":"post","link":"http:\/\/rcl-radio.ru\/?p=68615","title":{"rendered":"Arduino HC-06 (PWM + button)"},"content":{"rendered":"<p>\u0420\u0430\u043d\u0435\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"http:\/\/rcl-radio.ru\/?p=68590\"><strong>http:\/\/rcl-radio.ru\/?p=68590<\/strong><\/a> \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0440\u0435\u043c\u044f \u0440\u0435\u043b\u0435 (\u043d\u0430 \u0431\u0430\u0437\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b Arduino) \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Android (Bluetooth HC-06), \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u043c\u044f \u043a\u0430\u043d\u0430\u043b\u0430\u043c\u0438 \u0428\u0418\u041c \u043f\u043b\u0430\u0442\u044b Arduino \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Android \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<table style=\"border-collapse: collapse; width: 100%;\" border=\"1\">\n<tbody>\n<tr>\n<td style=\"width: 50%;\"><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/12\/Screenshot_2019-12-23-20-20-27-003_com.androidsmile.labbluetooth.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-68616\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/12\/Screenshot_2019-12-23-20-20-27-003_com.androidsmile.labbluetooth.png\" alt=\"\" width=\"1080\" height=\"1920\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/12\/Screenshot_2019-12-23-20-20-27-003_com.androidsmile.labbluetooth.png 1080w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/12\/Screenshot_2019-12-23-20-20-27-003_com.androidsmile.labbluetooth-200x356.png 200w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/12\/Screenshot_2019-12-23-20-20-27-003_com.androidsmile.labbluetooth-281x500.png 281w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/12\/Screenshot_2019-12-23-20-20-27-003_com.androidsmile.labbluetooth-768x1365.png 768w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/12\/Screenshot_2019-12-23-20-20-27-003_com.androidsmile.labbluetooth-576x1024.png 576w\" sizes=\"auto, (max-width: 1080px) 100vw, 1080px\" \/><\/a><\/td>\n<td style=\"width: 50%;\"><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/12\/Screenshot_2019-12-23-20-19-54-216_com.androidsmile.labbluetooth.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-68618\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/12\/Screenshot_2019-12-23-20-19-54-216_com.androidsmile.labbluetooth.png\" alt=\"\" width=\"1080\" height=\"1920\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/12\/Screenshot_2019-12-23-20-19-54-216_com.androidsmile.labbluetooth.png 1080w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/12\/Screenshot_2019-12-23-20-19-54-216_com.androidsmile.labbluetooth-200x356.png 200w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/12\/Screenshot_2019-12-23-20-19-54-216_com.androidsmile.labbluetooth-281x500.png 281w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/12\/Screenshot_2019-12-23-20-19-54-216_com.androidsmile.labbluetooth-768x1365.png 768w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/12\/Screenshot_2019-12-23-20-19-54-216_com.androidsmile.labbluetooth-576x1024.png 576w\" sizes=\"auto, (max-width: 1080px) 100vw, 1080px\" \/><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u0422\u0430\u043a \u0436\u0435 \u043f\u043e\u043c\u0438\u043c\u043e 2 \u043a\u0430\u043d\u0430\u043b\u043e\u0432 \u0428\u0418\u041c \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c 5-\u044e \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u043c\u0438 \u0432\u044b\u0445\u043e\u0434\u0430\u043c\u0438 \u043f\u043b\u0430\u0442\u044b Arduino. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u043b\u044f Android \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u0430\u043a\u0438\u0435 \u0432\u044b\u0445\u043e\u0434\u044b Arduino \u0412\u044b \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442\u0435. Android \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c Bluetooth \u043c\u043e\u0434\u0443\u043b\u044f HC06\u00a0 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0432 Serial Port \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, Arduido \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u044d\u0442\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u0445 \u0432\u044b\u0445\u043e\u0434\u043e\u0432. \u041a\u0430\u043a\u0438\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0432\u044b\u0445\u043e\u0434\u044b \u0432 Arduino \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0441\u043a\u0435\u0442\u0447\u0435\u043c.<\/p>\n<div id=\"marketWidget\"><\/div>\n<pre class=\"actionscript\" style=\"font-family: monospace; font-size: 10px;\"><span style=\"color: #0066cc;\">int<\/span> buff<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">2<\/span><span style=\"color: #66cc66;\">]<\/span>,i,dig,arr<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">2<\/span><span style=\"color: #66cc66;\">]<\/span>,w=<span style=\"color: #cc66cc;\">1<\/span>;\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> Serial.<span style=\"color: #006600;\">begin<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">9600<\/span><span style=\"color: #66cc66;\">)<\/span>;Serial.<span style=\"color: #006600;\">setTimeout<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">50<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n   pinMode<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">9<\/span>, OUTPUT<span style=\"color: #66cc66;\">)<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ PWM1<\/span>\r\n   pinMode<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">10<\/span>, OUTPUT<span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #808080; font-style: italic;\">\/\/ PWM2<\/span>\r\n   pinMode<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">11<\/span>, OUTPUT<span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #808080; font-style: italic;\">\/\/ P3 <\/span>\r\n   pinMode<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">12<\/span>, OUTPUT<span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #808080; font-style: italic;\">\/\/ P2 <\/span>\r\n   pinMode<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">13<\/span>, OUTPUT<span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #808080; font-style: italic;\">\/\/ P1<\/span>\r\n   pinMode<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">8<\/span>, OUTPUT<span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #808080; font-style: italic;\">\/\/ P4 <\/span>\r\n   pinMode<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">7<\/span>, OUTPUT<span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #808080; font-style: italic;\">\/\/ P5<\/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: #808080; font-style: italic;\">\/\/\/\/\/\/\/ \u041f\u0420\u0418\u0415\u041c \u0414\u0410\u041d\u041d\u042b\u0425 \u0421 SERIAL PORT \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<\/span>\r\n  <span style=\"color: #b1b100;\">while<\/span> <span style=\"color: #66cc66;\">(<\/span>Serial.<span style=\"color: #006600;\">available<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">&gt;<\/span><span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span> \r\n   <span style=\"color: #b1b100;\">for<\/span> <span style=\"color: #66cc66;\">(<\/span>i=<span style=\"color: #cc66cc;\">0<\/span>;i<span style=\"color: #66cc66;\">&lt;<\/span><span style=\"color: #cc66cc;\">1<\/span>;i++<span style=\"color: #66cc66;\">)<\/span> <span style=\"color: #66cc66;\">{<\/span> \r\n     buff<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">]<\/span> = Serial.<span style=\"color: #0066cc;\">parseInt<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>; \r\n     buff<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">]<\/span> = Serial.<span style=\"color: #0066cc;\">parseInt<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span>    \r\n   Serial.<span style=\"color: #006600;\">println<\/span><span style=\"color: #66cc66;\">(<\/span>buff<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">]<\/span>,DEC<span style=\"color: #66cc66;\">)<\/span>;w=<span style=\"color: #cc66cc;\">1<\/span>;<span style=\"color: #66cc66;\">}<\/span>\r\n\u00a0\r\n <span style=\"color: #808080; font-style: italic;\">\/\/\/\/\/\/\/\/\/\/\/\/\/ \u0420\u0410\u0417\u0414\u0415\u041b\u0415\u041d\u0418\u0415 \u0427\u0418\u0421\u041b\u0410 \u041d\u0410 \u041a\u041e\u0414 \u041a\u041e\u041c\u0410\u041d\u0414\u042b \u0418 \u0417\u041d\u0410\u0427\u0415\u041d\u0418\u0415 \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ <\/span>\r\n <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>buff<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">]<\/span><span style=\"color: #66cc66;\">&gt;<\/span><span style=\"color: #cc66cc;\">10<\/span><span style=\"color: #66cc66;\">&amp;&amp;<\/span>w==<span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span> w=<span style=\"color: #cc66cc;\">0<\/span>;\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>buff<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">]<\/span><span style=\"color: #66cc66;\">&gt;<\/span>=<span style=\"color: #cc66cc;\">10000<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>dig=buff<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">]<\/span>;arr<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">]<\/span>=dig<span style=\"color: #66cc66;\">\/<\/span><span style=\"color: #cc66cc;\">1000<\/span>;arr<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">]<\/span>=dig<span style=\"color: #66cc66;\">%<\/span>1000;<span style=\"color: #66cc66;\">}<\/span>\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>buff<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">]<\/span><span style=\"color: #66cc66;\">&lt;<\/span><span style=\"color: #cc66cc;\">10000<\/span><span style=\"color: #66cc66;\">&amp;&amp;<\/span>buff<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">]<\/span><span style=\"color: #66cc66;\">&gt;<\/span>=<span style=\"color: #cc66cc;\">1000<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>dig=buff<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">]<\/span>;arr<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">]<\/span>=dig<span style=\"color: #66cc66;\">\/<\/span><span style=\"color: #cc66cc;\">100<\/span>;arr<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">]<\/span>=dig<span style=\"color: #66cc66;\">%<\/span>100;<span style=\"color: #66cc66;\">}<\/span> \r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>buff<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">]<\/span><span style=\"color: #66cc66;\">&lt;<\/span><span style=\"color: #cc66cc;\">1000<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>dig=buff<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">]<\/span>;arr<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">]<\/span>=dig<span style=\"color: #66cc66;\">\/<\/span><span style=\"color: #cc66cc;\">10<\/span>;arr<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">]<\/span>=dig<span style=\"color: #66cc66;\">%<\/span>10;<span style=\"color: #66cc66;\">}<\/span>   \r\n    Serial.<span style=\"color: #006600;\">println<\/span><span style=\"color: #66cc66;\">(<\/span>arr<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">]<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n    Serial.<span style=\"color: #006600;\">println<\/span><span style=\"color: #66cc66;\">(<\/span>arr<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">]<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n    Serial.<span style=\"color: #006600;\">println<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #ff0000;\">\" \"<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n <span style=\"color: #66cc66;\">}<\/span> \r\n   <span style=\"color: #b1b100;\">switch<\/span><span style=\"color: #66cc66;\">(<\/span>arr<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">]<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>\r\n     <span style=\"color: #b1b100;\">case<\/span> <span style=\"color: #cc66cc;\">10<\/span>: pin<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #b1b100;\">break<\/span>;\r\n     <span style=\"color: #b1b100;\">case<\/span> <span style=\"color: #cc66cc;\">11<\/span>: analogWrite<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">9<\/span>,arr<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">]<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #b1b100;\">break<\/span>;\r\n     <span style=\"color: #b1b100;\">case<\/span> <span style=\"color: #cc66cc;\">12<\/span>: analogWrite<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">10<\/span>,arr<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">]<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #b1b100;\">break<\/span>;\r\n <span style=\"color: #66cc66;\">}<\/span>\r\n<span style=\"color: #66cc66;\">}<\/span>\r\n\u00a0\r\n<span style=\"color: #0066cc;\">void<\/span> pin<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>arr<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">]<\/span>==<span style=\"color: #cc66cc;\">1<\/span><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>arr<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">]<\/span>==<span style=\"color: #cc66cc;\">0<\/span><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  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>arr<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">]<\/span>==<span style=\"color: #cc66cc;\">3<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>digitalWrite<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">12<\/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>arr<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">]<\/span>==<span style=\"color: #cc66cc;\">2<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>digitalWrite<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">12<\/span>,LOW<span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span>  \r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>arr<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">]<\/span>==<span style=\"color: #cc66cc;\">5<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>digitalWrite<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">11<\/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>arr<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">]<\/span>==<span style=\"color: #cc66cc;\">4<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>digitalWrite<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">11<\/span>,LOW<span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span>\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>arr<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">]<\/span>==<span style=\"color: #cc66cc;\">7<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>digitalWrite<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">8<\/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>arr<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">]<\/span>==<span style=\"color: #cc66cc;\">6<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>digitalWrite<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">8<\/span>,LOW<span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span>\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>arr<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">]<\/span>==<span style=\"color: #cc66cc;\">9<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>digitalWrite<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">7<\/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>arr<span style=\"color: #66cc66;\">[<\/span><span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">]<\/span>==<span style=\"color: #cc66cc;\">8<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>digitalWrite<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">7<\/span>,LOW<span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span>\r\n  <span style=\"color: #66cc66;\">}<\/span><\/pre>\n<p>\u0426\u0438\u0444\u0440\u043e\u0432\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0438 \u0438\u043c\u0435\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434:<\/p>\n<ul>\n<li>100 &#8230;108 &#8212; 10 \u044d\u0442\u043e \u043a\u043e\u0434 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u043c\u0438 \u0432\u044b\u0445\u043e\u0434\u0430\u043c\u0438, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0442 0 \u0434\u043e 8 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u0445 \u0432\u044b\u0445\u043e\u0434\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 0 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432\u044b\u0445\u043e\u0434 D13 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043b\u043e\u0433. \u043d\u0443\u043b\u044f, 1 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043b\u043e\u0433. 1.<\/li>\n<li>11000&#8230;11255 &#8212; \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0428\u0418\u041c \u043a\u0430\u043d\u0430\u043b\u0430, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043e\u0442 0 \u0434\u043e 255 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u0441\u043a\u0432\u0430\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u043c\u043f\u0443\u043b\u044c\u0441\u043e\u0432 \u0428\u0418\u041c \u0441\u0438\u0433\u043d\u0430\u043b\u0430.<\/li>\n<li>12000&#8230;12255 &#8212; \u0428\u0418\u041c \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043a\u0430\u043d\u0430\u043b\u0430.<\/li>\n<\/ul>\n<p>\u0412 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0435 \u043f\u043e\u0440\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u043a\u043e\u0434\u044b \u043a\u043e\u043c\u0430\u043d\u0434 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0432 Android \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438.<\/p>\n<p><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/12\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2019-12-23-202112.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-68617\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/12\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2019-12-23-202112.png\" alt=\"\" width=\"196\" height=\"330\" \/><\/a><\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u043d\u0430 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0435, \u0432 Serial Port \u0447\u0435\u0440\u0435\u0437 Bluetooth \u0431\u044b\u043b\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 12153, \u0434\u0430\u043b\u0435\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u0434 \u043a\u043e\u043c\u0430\u043d\u0434\u044b 12 (\u0428\u0418\u041c 2) \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 153. \u0414\u0430\u043b\u0435\u0435 \u0432 \u0441\u043a\u0435\u0442\u0447\u0435 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<blockquote><p>analogWrite<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">10<\/span>,<strong>153<\/strong><span style=\"color: #66cc66;\">)<\/span>; \/\/\u00a0 D10 \u0428\u0418\u041c 2<\/p><\/blockquote>\n<p>\u0426\u0438\u0444\u0440\u043e\u0432\u044b\u0435 \u0432\u044b\u0445\u043e\u0434\u044b \u0428\u0418\u041c D9 D10, \u0432\u044b\u0445\u043e\u0434\u044b \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u043b\u0435 D13 D12 D11 D8 D7, \u0432\u0441\u0435 \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u044b \u0432 \u0441\u043a\u0435\u0442\u0447\u0435.<\/p>\n<p>\u0414\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0412\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043f\u043b\u0430\u0442\u0430 Arduino Nano (Uno), Bluetooth <a href=\"http:\/\/rcl-radio.ru\/?p=68590\">\u043c\u043e\u0434\u0443\u043b\u044c HC-06<\/a> (<a href=\"http:\/\/rcl-radio.ru\/?p=68590\"><strong>\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/strong><\/a>) \u0438 Android \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 &#8212; <strong><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/12\/arduino_2PWM_5button.apk_.zip\">arduino_2PWM_5button.apk<\/a><\/strong><\/p>\n<blockquote>\n<p style=\"text-align: center;\">\u0424\u043e\u0440\u0443\u043c (\u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438) &#8212; <a href=\"http:\/\/forum.rcl-radio.ru\/viewtopic.php?pid=602#p602\"><strong>http:\/\/forum.rcl-radio.ru\/viewtopic.php?pid=602#p602<\/strong><\/a><\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/forum.rcl-radio.ru\/viewtopic.php?pid=625#p625\">http:\/\/forum.rcl-radio.ru\/viewtopic.php?pid=625#p625<\/a><\/p>\n<\/blockquote>\n<p style=\"text-align: center;\"><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/Sa014YoSHKA\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0420\u0430\u043d\u0435\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 http:\/\/rcl-radio.ru\/?p=68590 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0440\u0435\u043c\u044f \u0440\u0435\u043b\u0435 (\u043d\u0430 \u0431\u0430\u0437\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b Arduino) \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Android (Bluetooth HC-06), \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u043c\u044f \u043a\u0430\u043d\u0430\u043b\u0430\u043c\u0438 \u0428\u0418\u041c \u043f\u043b\u0430\u0442\u044b Arduino \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Android \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0422\u0430\u043a \u0436\u0435 \u043f\u043e\u043c\u0438\u043c\u043e 2 \u043a\u0430\u043d\u0430\u043b\u043e\u0432 \u0428\u0418\u041c \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c 5-\u044e \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u043c\u0438 \u0432\u044b\u0445\u043e\u0434\u0430\u043c\u0438 \u043f\u043b\u0430\u0442\u044b Arduino. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u043b\u044f Android \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u0430\u043a\u0438\u0435 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":68618,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[239],"tags":[],"class_list":["post-68615","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino"],"views":5524,"_links":{"self":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/68615","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=68615"}],"version-history":[{"count":5,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/68615\/revisions"}],"predecessor-version":[{"id":111298,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/68615\/revisions\/111298"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/media\/68618"}],"wp:attachment":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=68615"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=68615"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=68615"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}