{"id":82151,"date":"2020-08-08T22:12:08","date_gmt":"2020-08-08T16:12:08","guid":{"rendered":"http:\/\/rcl-radio.ru\/?p=82151"},"modified":"2022-01-08T17:07:56","modified_gmt":"2022-01-08T11:07:56","slug":"%d0%bf%d0%be%d0%b4%d1%81%d0%b2%d0%b5%d1%82%d0%ba%d0%b0-%d0%b4%d0%bb%d1%8f-%d1%8d%d0%bd%d0%ba%d0%be%d0%b4%d0%b5%d1%80%d0%b0-arduino","status":"publish","type":"post","link":"http:\/\/rcl-radio.ru\/?p=82151","title":{"rendered":"\u041f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u0430 \u0434\u043b\u044f \u044d\u043d\u043a\u043e\u0434\u0435\u0440\u0430 (Arduino)"},"content":{"rendered":"<p>\u041f\u0440\u0438 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u0440\u0443\u0447\u043a\u0438 \u044d\u043d\u043a\u043e\u0434\u0435\u0440\u0430 ky-040 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c RGB \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u0443 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u044c\u0446\u0430.<\/p>\n<p><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/08\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-08-08-214508.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-82152\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/08\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-08-08-214508.png\" alt=\"\" width=\"439\" height=\"350\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/08\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-08-08-214508.png 735w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/08\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-08-08-214508-200x159.png 200w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/08\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-08-08-214508-500x399.png 500w\" sizes=\"auto, (max-width: 439px) 100vw, 439px\" \/><\/a>RGB (\u043d\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 WS2812) \u043a\u043e\u043b\u044c\u0446\u0430 \u0431\u044b\u0432\u0430\u044e\u0442 \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0441 \u0440\u0430\u0437\u043d\u044b\u043c \u043a\u043e\u043b-\u0432\u043e\u043c \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u043e\u0432, \u0434\u043b\u044f \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u0438 \u044d\u043d\u043a\u043e\u0434\u0435\u0440\u0430 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u043d\u043e\u0435 \u043a\u043e\u043b\u044c\u0446\u043e \u0441 \u0432\u043e\u0441\u0435\u043c\u044c\u044e \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u0430\u043c\u0438.<\/p>\n<table style=\"border-collapse: collapse; width: 100%;\" border=\"1\">\n<tbody>\n<tr style=\"height: 397px;\">\n<td style=\"width: 50%; height: 397px;\"><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/08\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-08-08-214534.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-82153\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/08\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-08-08-214534.png\" alt=\"\" width=\"651\" height=\"542\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/08\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-08-08-214534.png 651w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/08\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-08-08-214534-200x167.png 200w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/08\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-08-08-214534-500x416.png 500w\" sizes=\"auto, (max-width: 651px) 100vw, 651px\" \/><\/a><\/td>\n<td style=\"width: 50%; height: 397px;\"><img decoding=\"async\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2018\/07\/%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA-%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0-%D0%BE%D1%82-2018-07-28-174033.png\" \/><\/td>\n<\/tr>\n<tr style=\"height: 21px;\">\n<td style=\"width: 50%; height: 21px;\"><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/08\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-08-08-215435.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-82155\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/08\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-08-08-215435.png\" alt=\"\" width=\"690\" height=\"397\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/08\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-08-08-215435.png 690w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/08\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-08-08-215435-200x115.png 200w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/08\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-08-08-215435-500x288.png 500w\" sizes=\"auto, (max-width: 690px) 100vw, 690px\" \/><\/a><\/td>\n<td style=\"width: 50%; height: 21px;\"><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/08\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-08-08-215447.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-82154\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/08\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-08-08-215447.png\" alt=\"\" width=\"331\" height=\"285\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/08\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-08-08-215447.png 331w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/08\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-08-08-215447-200x172.png 200w\" sizes=\"auto, (max-width: 331px) 100vw, 331px\" \/><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u0421\u043a\u0435\u0442\u0447 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0441\u044f \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u044b Arduino \u0433\u0434\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u044d\u043d\u043a\u043e\u0434\u0435\u0440\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u044b\u0445 \u0440\u0435\u0433\u0443\u043b\u044f\u0442\u043e\u0440\u043d\u044b\u0445 \u0433\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u0438.<\/p>\n<p>\u041f\u0440\u0438 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u0440\u0443\u0447\u043a\u0438 \u044d\u043d\u043a\u043e\u0434\u0435\u0440\u0430 \u0437\u0430\u0433\u043e\u0440\u0430\u044e\u0442\u0441\u044f \u0438 \u0433\u0430\u0441\u043d\u0443\u0442 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u044b. \u0421\u043a\u0435\u0442\u0447 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442\u00a0 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u044d\u043d\u043a\u043e\u0434\u0435\u0440\u043e\u043c \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u00a0 (\u043e\u0442 0 \u0434\u043e 79 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439), \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u044b \u0437\u0430\u0433\u043e\u0440\u0430\u044e\u0442\u0441\u044f \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c \u0446\u0432\u0435\u0442\u043e\u043c, \u043e\u0442 \u0441\u0438\u043d\u0435\u0433\u043e \u0438 \u043f\u043b\u0430\u0432\u043d\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0432 \u043a\u0440\u0430\u0441\u043d\u044b\u0439 (\u043f\u0440\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435).<\/p>\n<div id=\"marketWidget\"><\/div>\n<p style=\"text-align: center;\"><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/dWcrdWXSs1I\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<pre class=\"actionscript\" style=\"font-family: monospace; font-size: 10px;\"><span style=\"color: #808080; font-style: italic;\">#include &lt;Adafruit_NeoPixel.h&gt; \/\/ https:\/\/github.com\/adafruit\/Adafruit_NeoPixel.git<\/span>\r\n<span style=\"color: #808080; font-style: italic;\">#include &lt;Encoder.h&gt;  \/\/ http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/05\/Encoder.zip<\/span>\r\n  Adafruit_NeoPixel strip = Adafruit_NeoPixel<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">8<\/span>, <span style=\"color: #cc66cc;\">6<\/span>, NEO_GRB + NEO_KHZ800<span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #808080; font-style: italic;\">\/\/ 8 LED, D6<\/span>\r\n  Encoder myEnc<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">9<\/span>, <span style=\"color: #cc66cc;\">8<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #808080; font-style: italic;\">\/\/CLK, DT<\/span>\r\n  unsigned long oldPosition  = -<span style=\"color: #cc66cc;\">999<\/span>,newPosition;\r\n  <span style=\"color: #0066cc;\">int<\/span> poz,<span style=\"color: #0066cc;\">data<\/span>;\r\n  <span style=\"color: #808080; font-style: italic;\">#define KOL 79 \/\/ \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u0438<\/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>  \r\n  OCR1A = <span style=\"color: #cc66cc;\">5000<\/span>; TCCR1B <span style=\"color: #66cc66;\">|<\/span>= <span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1<\/span> <span style=\"color: #66cc66;\">&lt;&lt;<\/span> WGM12<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">|<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1<\/span> <span style=\"color: #66cc66;\">&lt;&lt;<\/span> CS10<span style=\"color: #66cc66;\">)<\/span>; TIMSK1 <span style=\"color: #66cc66;\">|<\/span>= <span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1<\/span> <span style=\"color: #66cc66;\">&lt;&lt;<\/span> OCIE1A<span style=\"color: #66cc66;\">)<\/span>;\r\n  strip.<span style=\"color: #006600;\">begin<\/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;\">7<\/span>,INPUT<span style=\"color: #66cc66;\">)<\/span>;\r\n  strip.<span style=\"color: #006600;\">setBrightness<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">32<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n  poz = <span style=\"color: #0066cc;\">data<\/span><span style=\"color: #66cc66;\">\/<\/span><span style=\"color: #cc66cc;\">8<\/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;\">7<\/span><span style=\"color: #66cc66;\">)<\/span>==LOW<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>\r\n    <span style=\"color: #b1b100;\">for<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #0066cc;\">int<\/span> i=<span style=\"color: #cc66cc;\">0<\/span>;i<span style=\"color: #66cc66;\">&lt;<\/span><span style=\"color: #cc66cc;\">8<\/span>;i++<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>strip.<span style=\"color: #006600;\">setPixelColor<\/span><span style=\"color: #66cc66;\">(<\/span>i, strip.<span style=\"color: #0066cc;\">Color<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">0<\/span>, <span style=\"color: #cc66cc;\">50<\/span>, <span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span>strip.<span style=\"color: #0066cc;\">show<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;delay<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">300<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n    <span style=\"color: #b1b100;\">for<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #0066cc;\">int<\/span> i=<span style=\"color: #cc66cc;\">0<\/span>;i<span style=\"color: #66cc66;\">&lt;<\/span><span style=\"color: #cc66cc;\">8<\/span>;i++<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>strip.<span style=\"color: #006600;\">setPixelColor<\/span><span style=\"color: #66cc66;\">(<\/span>i, strip.<span style=\"color: #0066cc;\">Color<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">0<\/span>, <span style=\"color: #cc66cc;\">0<\/span>, <span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span>strip.<span style=\"color: #0066cc;\">show<\/span><span style=\"color: #66cc66;\">(<\/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>newPosition <span style=\"color: #66cc66;\">!<\/span>= oldPosition<span style=\"color: #66cc66;\">)<\/span> <span style=\"color: #66cc66;\">{<\/span>oldPosition = newPosition;\r\n    <span style=\"color: #0066cc;\">data<\/span>=<span style=\"color: #0066cc;\">data<\/span>+newPosition;<span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>data<span style=\"color: #66cc66;\">&gt;<\/span>=<span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">&amp;&amp;<\/span>data<span style=\"color: #66cc66;\">&lt;<\/span>=KOL<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>poz=poz+newPosition;<span style=\"color: #66cc66;\">}<\/span>myEnc.<span style=\"color: #006600;\">write<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">)<\/span>;newPosition=<span style=\"color: #cc66cc;\">0<\/span>;\r\n    Serial.<span style=\"color: #006600;\">println<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #0066cc;\">data<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span>\r\n\u00a0\r\n    strip.<span style=\"color: #006600;\">setPixelColor<\/span><span style=\"color: #66cc66;\">(<\/span>poz-<span style=\"color: #cc66cc;\">1<\/span>, strip.<span style=\"color: #0066cc;\">Color<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">0<\/span>, <span style=\"color: #cc66cc;\">0<\/span>, <span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n    strip.<span style=\"color: #006600;\">setPixelColor<\/span><span style=\"color: #66cc66;\">(<\/span>poz, strip.<span style=\"color: #0066cc;\">Color<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #0066cc;\">data<\/span>, <span style=\"color: #cc66cc;\">0<\/span>+<span style=\"color: #0066cc;\">data<\/span><span style=\"color: #66cc66;\">\/<\/span><span style=\"color: #cc66cc;\">10<\/span>, KOL-<span style=\"color: #0066cc;\">data<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n    strip.<span style=\"color: #006600;\">setPixelColor<\/span><span style=\"color: #66cc66;\">(<\/span>poz+<span style=\"color: #cc66cc;\">1<\/span>, strip.<span style=\"color: #0066cc;\">Color<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">0<\/span>, <span style=\"color: #cc66cc;\">0<\/span>, <span style=\"color: #cc66cc;\">0<\/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>poz<span style=\"color: #66cc66;\">&gt;<\/span><span style=\"color: #cc66cc;\">7<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>poz=<span style=\"color: #cc66cc;\">0<\/span>;<span style=\"color: #66cc66;\">}<\/span><span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>poz<span style=\"color: #66cc66;\">&lt;<\/span><span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>poz=poz+<span style=\"color: #cc66cc;\">8<\/span>;<span style=\"color: #66cc66;\">}<\/span>\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>data<span style=\"color: #66cc66;\">&lt;<\/span><span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span><span style=\"color: #0066cc;\">data<\/span>=<span style=\"color: #cc66cc;\">0<\/span>;<span style=\"color: #66cc66;\">}<\/span><span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>data<span style=\"color: #66cc66;\">&gt;<\/span>KOL<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span><span style=\"color: #0066cc;\">data<\/span>=KOL;<span style=\"color: #66cc66;\">}<\/span>\r\n    strip.<span style=\"color: #0066cc;\">show<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n<span style=\"color: #66cc66;\">}<\/span><span style=\"color: #808080; font-style: italic;\">\/\/ LOOP<\/span>\r\nISR <span style=\"color: #66cc66;\">(<\/span>TIMER1_COMPA_vect<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>newPosition = myEnc.<span style=\"color: #006600;\">read<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">\/<\/span><span style=\"color: #cc66cc;\">4<\/span>;<span style=\"color: #66cc66;\">}<\/span><\/pre>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <strong>data <\/strong>\u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u0438, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u0438 \u044d\u043d\u043a\u043e\u0434\u0435\u0440\u0430.<\/p>\n<p>RGB \u043a\u043e\u043b\u044c\u0446\u043e \u043d\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 W2812 \u043f\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u044f 5 \u0412, \u0432\u044b\u0445\u043e\u0434 D6 Arduino \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a\u043e \u0432\u0445\u043e\u0434\u0443 DI \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u044c\u0446\u0430.<\/p>\n<p>\u0424\u043e\u0440\u0443\u043c &#8212; <a href=\"http:\/\/forum.rcl-radio.ru\/viewtopic.php?pid=1966#p1966\">http:\/\/forum.rcl-radio.ru\/viewtopic.php?pid=1966#p1966<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u0440\u0438 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u0440\u0443\u0447\u043a\u0438 \u044d\u043d\u043a\u043e\u0434\u0435\u0440\u0430 ky-040 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c RGB \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u0443 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u044c\u0446\u0430. RGB (\u043d\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 WS2812) \u043a\u043e\u043b\u044c\u0446\u0430 \u0431\u044b\u0432\u0430\u044e\u0442 \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0441 \u0440\u0430\u0437\u043d\u044b\u043c \u043a\u043e\u043b-\u0432\u043e\u043c \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u043e\u0432, \u0434\u043b\u044f \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u0438 \u044d\u043d\u043a\u043e\u0434\u0435\u0440\u0430 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u043d\u043e\u0435 \u043a\u043e\u043b\u044c\u0446\u043e \u0441 \u0432\u043e\u0441\u0435\u043c\u044c\u044e \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u0430\u043c\u0438. \u0421\u043a\u0435\u0442\u0447 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0441\u044f \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u044b Arduino \u0433\u0434\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u044d\u043d\u043a\u043e\u0434\u0435\u0440\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u044b\u0445 \u0440\u0435\u0433\u0443\u043b\u044f\u0442\u043e\u0440\u043d\u044b\u0445 \u0433\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u0438. \u041f\u0440\u0438 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u0440\u0443\u0447\u043a\u0438 \u044d\u043d\u043a\u043e\u0434\u0435\u0440\u0430 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":82154,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[239],"tags":[],"class_list":["post-82151","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino"],"views":6545,"_links":{"self":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/82151","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=82151"}],"version-history":[{"count":5,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/82151\/revisions"}],"predecessor-version":[{"id":111220,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/82151\/revisions\/111220"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/media\/82154"}],"wp:attachment":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=82151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=82151"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=82151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}