{"id":264722,"date":"2015-09-01T16:04:03","date_gmt":"2015-09-01T12:04:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=264722"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=264722","title":{"rendered":"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Cylon.js \u0441 \u043f\u043b\u0430\u0442\u043e\u0439 Intel Edison \u0438 \u043d\u0430\u0431\u043e\u0440\u043e\u043c Intel IoT Developer Kit"},"content":{"rendered":"<p>       Intel Edison \u044d\u0442\u043e \u043d\u043e\u0432\u044b\u0439 \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u0434\u043d\u043e\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440. \u0421 \u0434\u0432\u0443\u0445\u044a\u044f\u0434\u0435\u0440\u043d\u044b\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u043c, \u043f\u043e\u0440\u0442\u0430\u043c\u0438 \u0432\u0432\u043e\u0434\u0430-\u0432\u044b\u0432\u043e\u0434\u0430 \u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u043c\u0438, \u043f\u043b\u0430\u0442\u0430 Intel Edison \u0438\u043c\u0435\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b \u0434\u043b\u044f Physical computing (Physical computing \u2014 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f. \u0421\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u0432 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0435\u0435 \u0435\u043c\u0443 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438\u0437 \u043e\u043a\u0440\u0443\u0436\u0430\u044e\u0449\u0435\u0433\u043e \u043c\u0438\u0440\u0430 \u0438 \u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043d\u0435\u0451). \u0412\u043e\u0442 \u043f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043f\u043e\u043b\u043d\u0443\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0434\u043b\u044f \u043f\u043b\u0430\u0442\u044b Intel Edison \u0432 <a href=\"http:\/\/cylonjs.com\">Cylon.js<\/a>, \u043d\u0430\u0448 JavaScript-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u0434\u043b\u044f \u0440\u043e\u0431\u043e\u0442\u043e\u0432 \u0438 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430 \u0432\u0435\u0449\u0435\u0439 (IoT).<br \/>  \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u0442 \u043d\u043e\u0432\u0438\u0447\u043a\u0430\u043c \u0441 \u0447\u0435\u0433\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u0438 \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u043e\u043b\u043d\u043e\u043c\u0443 \u043d\u0430\u0431\u043e\u0440\u0443 \u0432\u0441\u0435\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439. \u041c\u044b \u043f\u043e\u043a\u0430\u0436\u0435\u043c \u0432\u0430\u043c, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Cylon.js \u043f\u043e\u0447\u0442\u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u043d\u0430\u0431\u043e\u0440 Intel IoT Developer Kit. \u0417\u0430\u043c\u0435\u0442\u044c\u0442\u0435, \u043c\u044b \u0441\u043a\u0430\u0437\u0430\u043b\u0438 \u00ab\u043f\u043e\u0447\u0442\u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0445\u00bb, \u043c\u044b \u043d\u0435 \u0441\u0442\u0430\u043b\u0438 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0440\u0435\u043b\u0435, \u0442.\u043a. \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e. \u0410 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0445 \u043e\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u044f \u0441 \u043f\u043b\u0430\u0442\u043e\u0439 Intel Edison, \u044d\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0442\u0435\u043c\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<p>  \u041f\u043b\u0430\u0442\u0430 Intel Edison, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u043e \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0451, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0432 \u043d\u0430\u0431\u043e\u0440\u0435:<\/p>\n<p>  <a href=\"http:\/\/geektimes.ru\/company\/intel\/blog\/261094\/\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/c86\/b50\/994\/c86b50994a2444e0a7448e4832d59169.jpg\" \/><\/div>\n<p><\/a><br \/>  <a name=\"habracut\"><\/a>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f Cylon.js \u043c\u044b \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u043c \u0432\u0441\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0434\u043d\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u2014 \u0443\u043c\u043d\u0443\u044e \u0432\u0445\u043e\u0434\u043d\u0443\u044e \u0434\u0432\u0435\u0440\u044c. \u0414\u0432\u0435\u0440\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0432 \u0441\u0435\u0431\u044f \u043e\u0441\u0432\u0435\u0449\u0435\u043d\u0438\u0435, \u043f\u0438\u0449\u0430\u043b\u043a\u0443, LCD \u044d\u043a\u0440\u0430\u043d, \u0437\u0432\u0443\u043a\u043e\u0432\u043e\u0439 \u0438 \u0441\u0432\u0435\u0442\u043e\u0432\u043e\u0439 \u0434\u0430\u0442\u0447\u0438\u043a\u0438 \u0438 \u0441\u0432\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 API. \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u043d\u043e\u0435 IoT-\u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u0445\u043e\u0442\u044f \u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430.<\/p>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u043f\u0438\u0442\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b\u0439 \u0442\u043e\u043a \u0434\u043b\u044f \u043f\u0438\u0442\u0430\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0432\u0441\u0435\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0445 \u043a \u043f\u043b\u0430\u0442\u0435 Intel Edison. \u041f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u043b\u044e\u0431\u043e\u0439 \u0431\u043b\u043e\u043a \u043f\u0438\u0442\u0430\u043d\u0438\u044f, \u0441 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435\u043c 7-15 \u0412 \u0438 \u0442\u043e\u043a\u043e\u043c 1 \u0410.<\/p>\n<h2><font color=\"#0071c5\">\u0427\u0430\u0441\u0442\u044c 1. \u0421\u0432\u0435\u0442<\/font><\/h2>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434. \u041c\u044b \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043e\u0441\u0432\u0435\u0449\u0435\u043d\u0438\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434 \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430. \u0412\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u0430, \u044d\u0442\u043e \u0447\u0442\u043e-\u0442\u043e \u0442\u0438\u043f\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u00abHello, World\u00bb \u0434\u043b\u044f IoT, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043b\u0443\u0436\u0438\u0442 \u0445\u043e\u0440\u043e\u0448\u0438\u043c \u0441\u0442\u0430\u0440\u0442\u043e\u043c. \u041c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043b\u0430\u0442\u0443-\u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u0435\u043b\u044c \u0434\u043b\u044f \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u0430. \u0412\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u0437 \u0446\u0432\u0435\u0442\u043d\u044b\u0445 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u043e\u0432 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0435\u0433\u043e \u043a \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0439 Grove \u043f\u043b\u0430\u0442\u0435. \u041f\u043e\u043c\u043d\u0438\u0442\u0435, \u0447\u0442\u043e \u0434\u043b\u0438\u043d\u043d\u0430\u044f \u043d\u043e\u0436\u043a\u0430 \u0443 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u0430 \u044d\u0442\u043e \u00ab+\u00bb (\u0430\u043d\u043e\u0434), \u0438 \u043e\u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u043a \u00ab+\u00bb \u043d\u0430 \u043f\u043b\u0430\u0442\u0435 Grove.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/41d\/e60\/7dd\/41de607dd808456c83d4c747754cba34.jpg\"\/>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 main.js<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\"> &quot;use strict&quot;;   var cylon = require(&quot;cylon&quot;);   cylon.robot({   name: &quot;doorbot&quot;,   connections: {     edison: { adaptor: &quot;intel-iot&quot; }   },   devices: {     led: { driver: &quot;led&quot;, pin: 3, connection: &quot;edison&quot; }   },   work: function() {     var that = this;       setInterval(function() {       that.led.toggle()     }, 1000);   } }).start();<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043a\u043e\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e <a href=\"https:\/\/github.com\/hybridgroup\/Using-Cylon.js-With-The-Intel-Edison-and-IoT-Starter-Kit\/blob\/master\/1.js\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>. \u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u0438\u043b\u0438 \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0432 \u0444\u0430\u0439\u043b \u00abmain.js\u00bb \u0432 \u043e\u043a\u043d\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Intel\u00ae XDK IoT Edition, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0435\u0433\u043e \u0438 \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u043d\u0430 \u043f\u043b\u0430\u0442\u0443.<\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0438 \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043c\u0438\u0433\u0430\u044e\u0449\u0438\u0439 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434.<\/p>\n<h2><font color=\"#0071c5\">\u0427\u0430\u0441\u0442\u044c 2. \u0412\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044c \u0441\u0432\u0435\u0442\u0430<\/font><\/h2>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0443. \u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043a\u043d\u043e\u043f\u043a\u0443, \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u043c\u043e\u0436\u0435\u0442 \u0441\u0430\u043c \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0438 \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434. \u0412 \u043a\u043e\u0434\u0435 \u0432\u0438\u0434\u043d\u043e \u043a\u0430\u043a Cylon.js \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u043d\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0438\u0437 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0438\u0440\u0430. \u0415\u0441\u043b\u0438 \u0432\u044b \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 jQuery, \u0442\u043e \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0438\u0434\u0438\u043e\u043c\u0443 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u00abMouseOver\u00bb. Cylon.js \u0448\u0438\u0440\u043e\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u043c \u043e\u0442 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u043a\u043d\u043e\u043f\u043a\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0434\u0432\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u00abpush\u00bb \u0438 \u00abrelease\u00bb (\u00ab\u043d\u0430\u0436\u0430\u0442\u044c\u00bb \u0438 \u00ab\u043e\u0442\u043f\u0443\u0441\u0442\u0438\u0442\u044c\u00bb). \u041c\u044b \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u043c \u044d\u0442\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0441\u043e \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u043e\u043c \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u0438 \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043a\u043d\u043e\u043f\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0436\u0430\u0442\u0430 \u0438\u043b\u0438 \u043e\u0442\u043f\u0443\u0449\u0435\u043d\u0430.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/69b\/f2b\/d66\/69bf2bd66b414e0aa6f61006774cecad.jpg\"\/>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 main.js<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">&quot;use strict&quot;;   var cylon = require(&quot;cylon&quot;);   cylon.robot({   name: &quot;doorbot&quot;,   connections: {     edison: { adaptor: &quot;intel-iot&quot; }   },   devices: {     \/\/ digital sensors     button: { driver: &quot;button&quot;,        pin: 2, connection: &quot;edison&quot; },     led:    { driver: &quot;led&quot;,           pin: 3, connection: &quot;edison&quot; },   },   setup: function() {     this.led.turnOff();   },   work: function() {     var that = this;     that.setup();      that.button.on('push', function() {       that.led.turnOn();     });       that.button.on('release', function() {       that.led.turnOff();     });   } }).start();<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043a\u043e\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e <a href=\"https:\/\/github.com\/hybridgroup\/Using-Cylon.js-With-The-Intel-Edison-and-IoT-Starter-Kit\/blob\/master\/2.js\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>. \u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u0438\u043b\u0438 \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0432 \u0444\u0430\u0439\u043b \u00abmain.js\u00bb \u0432 \u043e\u043a\u043d\u0435 Intel\u00ae XDK IoT Edition, \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0432\u0435\u0441\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043a\u043e\u0434, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0438 \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0435\u0433\u043e \u043d\u0430 \u043f\u043b\u0430\u0442\u0443.<\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0438 \u043f\u043e\u043c\u0438\u0433\u0430\u0439\u0442\u0435 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u043e\u043c, \u043d\u0430\u0436\u0438\u043c\u0430\u044f \u043a\u043d\u043e\u043f\u043a\u0443.<\/p>\n<h2><font color=\"#0071c5\">\u0427\u0430\u0441\u0442\u044c 3. \u0414\u0438\u0441\u043f\u043b\u0435\u0439<\/font><\/h2>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0416\u041a-\u044d\u043a\u0440\u0430\u043d. \u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0434\u0438\u0441\u043f\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043d\u0430\u043c \u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u043f\u043b\u0430\u0442\u0435, \u043f\u043e\u043a\u0430 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432 \u043d\u0430\u0448\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u042d\u0442\u043e \u0416\u041a-\u0434\u0438\u0441\u043f\u043b\u0435\u0439 \u0441 RGB-\u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u043e\u0439 \u0444\u043e\u043d\u0430. \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043d\u0430\u043c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0438 \u043c\u0435\u043d\u044f\u0442\u044c \u0446\u0432\u0435\u0442 \u0444\u043e\u043d\u043e\u0432\u043e\u0439 \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u0438.<\/p>\n<p>  \u0416\u041a-\u044d\u043a\u0440\u0430\u043d \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430, \u044d\u0442\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u043e\u0435 \u043f\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0448\u0438\u043d\u0435 I2C. I2C-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u044d\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u0442\u0438\u043f\u043e\u0432 \u0432\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0445 \u0441\u0435\u043d\u0441\u043e\u0440\u043e\u0432 \u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432. \u041d\u0430\u043c \u043d\u0430\u0434\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0435\u0433\u043e \u043a \u0440\u0430\u0437\u044a\u0435\u043c\u0443 \u00abi2c\u00bb \u043d\u0430 Grove-\u0448\u0438\u043b\u0434\u0435.<\/p>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043a\u043e\u0434 \u0434\u043b\u044f \u0416\u041a-\u044d\u043a\u0440\u0430\u043d\u0430. \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043a\u043e\u0434 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u0412 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043a\u043e\u0434 \u0434\u043b\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f button.on(\u201crelease\u201d) \u0438 (\u201cpush\u201d) \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u044d\u043a\u0440\u0430\u043d\u0430 \u0441 \u0442\u0435\u043a\u0443\u0449\u0438\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u043e\u0441\u0432\u0435\u0449\u0435\u043d\u0438\u044f.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/014\/068\/fec\/014068fec86445378abc03b63cdbb143.jpg\"\/>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 main.js<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">&quot;use strict&quot;;   var cylon = require(&quot;cylon&quot;);   cylon.robot({   name: &quot;doorbot&quot;,   connections: {     edison: { adaptor: &quot;intel-iot&quot; }   },   devices: {     \/\/ digital sensors     button: { driver: &quot;button&quot;,        pin: 2, connection: &quot;edison&quot; },     led:    { driver: &quot;led&quot;,           pin: 3, connection: &quot;edison&quot; },     \/\/ i2c devices     screen: { driver: &quot;upm-jhd1313m1&quot;, connection: &quot;edison&quot; }   },   writeMessage: function(message, color) {     var that = this;     var str = message.toString();     while (str.length &lt; 16) {       str = str + &quot; &quot;;     }     console.log(message);     that.screen.setCursor(0,0);     that.screen.write(str);     switch(color)     {       case &quot;red&quot;:         that.screen.setColor(255, 0, 0);         break;       case &quot;green&quot;:         that.screen.setColor(0, 255, 0);         break;       case &quot;blue&quot;:         that.screen.setColor(0, 0, 255);         break;       default:         that.screen.setColor(255, 255, 255);         break;     }   },   reset: function() {     this.writeMessage(&quot;Doorbot ready&quot;);     this.led.turnOff();   },   work: function() {     var that = this;     that.reset();      that.button.on('push', function() {       that.led.turnOn();       that.writeMessage(&quot;Lights On&quot;, &quot;blue&quot;);     });       that.button.on('release', function() {       that.reset();     });   } }).start();<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043a\u043e\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e <a href=\"https:\/\/github.com\/hybridgroup\/Using-Cylon.js-With-The-Intel-Edison-and-IoT-Starter-Kit\/blob\/master\/3.js\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>. \u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u0438\u043b\u0438 \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0432 \u0444\u0430\u0439\u043b \u00abmain.js\u00bb \u0432 \u043e\u043a\u043d\u0435 Intel\u00ae XDK IoT Edition, \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0432\u0435\u0441\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043a\u043e\u0434, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0438 \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0435\u0433\u043e \u043d\u0430 \u043f\u043b\u0430\u0442\u0443.<\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u043f\u043e\u043d\u0430\u0436\u0438\u043c\u0430\u0439\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043d\u0430 \u0416\u041a-\u044d\u043a\u0440\u0430\u043d\u0435.<\/p>\n<h2><font color=\"#0071c5\">\u0427\u0430\u0441\u0442\u044c 4 \u2014 Web API<\/font><\/h2>\n<p>  \u041c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c Cylon.js HTTP API, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043d\u0430\u043c \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c REST. Cylon.js API \u0438\u043c\u0435\u0435\u0442 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0432 \u0432\u0438\u0434\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0435\u0433\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0435\u0439. \u0421\u0435\u0439\u0447\u0430\u0441 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u00abhttp\u00bb, \u00absocketio\u00bb, \u0438 \u00abmqtt\u00bb. \u0412\u0441\u043a\u043e\u0440\u0435 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0449\u0451.<\/p>\n<p>  \u041f\u043b\u0430\u0433\u0438\u043d HTTP API \u0442\u0430\u043a\u0436\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 Robeaux (<a href=\"http:\/\/robeaux.io\">http:\/\/robeaux.io<\/a>), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u043c, \u043e\u0434\u043d\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u043c \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u043d\u0430 React. \u042d\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0430\u043d\u0435\u043b\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441 \u0442\u0435\u043a\u0443\u0449\u0438\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u0432\u0430\u0448\u0435\u0433\u043e \u0440\u043e\u0431\u043e\u0442\u0430 \u0438 \u0434\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043c\u0435\u043d\u044f\u0442\u044c \u0435\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b.<\/p>\n<p>  \u0412 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 API-\u043f\u043b\u0430\u0433\u0438\u043d\u0430\u0445 Cylon.js \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0435\u0434\u0438\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0441 \u043a\u0430\u043a\u0438\u043c \u0440\u043e\u0431\u043e\u0442\u043e\u043c \u0438\u043b\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\u043c \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u042d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u043f\u0443\u0442\u0438 \u043a\u0430\u043a \u0432 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043e\u043f\u0438\u0441\u0430\u043d \u0432 \u0444\u043e\u0440\u043c\u0435 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439 \u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f Common Protocol for Programming Physical Input\/Output \u0438\u043b\u0438 \u043a\u0440\u0430\u0442\u043a\u043e \u00abcppp.io\u00bb.<\/p>\n<p>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043d\u0430\u0448\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u00abDoorbot\u00bb, \u043f\u0443\u0442\u044c \u043a \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u0443 \u0431\u0443\u0434\u0435\u0442 \u00ab\/api\/robots\/doorbot\/devices\/led\u00bb. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0448\u0430\u0431\u043b\u043e\u043d \u00ab\/api\/robots\/&lt;robot name&gt;\/devices\/&lt;device name&gt;\u00bb \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Cylon.js API \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0430\u0448\u0438\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\u043c \u0438\u043b\u0438 \u043f\u043e\u0441\u044b\u043b\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043d\u0430\u0448\u0435\u043c\u0443 \u0440\u043e\u0431\u043e\u0442\u0443.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 main.js<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">&quot;use strict&quot;;   var cylon = require(&quot;cylon&quot;);   cylon.api({   host: &quot;0.0.0.0&quot;,   port: &quot;3000&quot;,   ssl: false });   cylon.robot({   name: &quot;doorbot&quot;,   connections: {     edison: { adaptor: &quot;intel-iot&quot; }   },   devices: {     \/\/ digital sensors     button: { driver: &quot;button&quot;,        pin: 2, connection: &quot;edison&quot; },     led:    { driver: &quot;led&quot;,           pin: 3, connection: &quot;edison&quot; },     \/\/ i2c devices     screen: { driver: &quot;upm-jhd1313m1&quot;, connection: &quot;edison&quot; }   },   writeMessage: function(message, color) {     var that = this;     var str = message.toString();     while (str.length &lt; 16) {       str = str + &quot; &quot;;     }     console.log(message);     that.screen.setCursor(0,0);     that.screen.write(str);     switch(color)     {       case &quot;red&quot;:         that.screen.setColor(255, 0, 0);         break;       case &quot;green&quot;:         that.screen.setColor(0, 255, 0);         break;       case &quot;blue&quot;:         that.screen.setColor(0, 0, 255);         break;       default:         that.screen.setColor(255, 255, 255);         break;     }   },   reset: function() {     this.writeMessage(&quot;Doorbot ready&quot;);     this.led.turnOff();   },   work: function() {     var that = this;     that.reset();      that.button.on('push', function() {       that.led.turnOn();       that.writeMessage(&quot;Lights On&quot;, &quot;blue&quot;);     });       that.button.on('release', function() {       that.reset();     });   } }).start();<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043a\u043e\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e <a href=\"https:\/\/github.com\/hybridgroup\/Using-Cylon.js-With-The-Intel-Edison-and-IoT-Starter-Kit\/blob\/master\/4.js\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>. \u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u0438\u043b\u0438 \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0432 \u0444\u0430\u0439\u043b \u00abmain.js\u00bb \u0432 \u043e\u043a\u043d\u0435 Intel\u00ae XDK IoT Edition, \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0432\u0435\u0441\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043a\u043e\u0434, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0438 \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0435\u0433\u043e \u043d\u0430 \u043f\u043b\u0430\u0442\u0443.<\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0438 \u0437\u0430\u0439\u0434\u0438\u0442\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u043c \u043f\u043e IP-\u0430\u0434\u0440\u0435\u0441\u0443 \u0432\u0430\u0448\u0435\u0439 \u043f\u043b\u0430\u0442\u044b, \u0443\u043a\u0430\u0437\u0430\u0432 \u043f\u043e\u0440\u0442 3000 (\u044d\u0442\u043e \u043f\u043e\u0440\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043b\u044f Robeaux). \u0412\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/ef6\/26d\/5ea\/ef626d5ea8004e9c90ceefcba40e900b.png\"\/><\/p>\n<p>  \u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u00abdoorbot\u00bb. \u0412\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432. \u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u00abbutton\u00bb. \u0411\u0443\u0434\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043f\u043e \u044d\u0442\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0435.<\/p>\n<p>  \u0412 \u0431\u043b\u043e\u043a\u0435 \u00abDevice Events\u00bb \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u0432 \u043f\u043e\u043b\u0435 \u0432\u0432\u043e\u0434\u0430 \u0441\u0442\u0440\u043e\u043a\u0443 \u00abpush\u00bb, \u0437\u0430\u0442\u0435\u043c \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 \u00abListen\u00bb. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u0443\u044e \u043a\u043d\u043e\u043f\u043a\u0443. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043f\u043e\u044f\u0432\u0438\u0432\u0448\u0435\u0435\u0441\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043d\u0430 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435. \u042d\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u0430\u0448\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e.<\/p>\n<h2><font color=\"#0071c5\">\u0427\u0430\u0441\u0442\u044c 5. \u0414\u0432\u0435\u0440\u043d\u043e\u0439 \u0437\u0432\u043e\u043d\u043e\u043a<\/font><\/h2>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0430\u0442\u0447\u0438\u043a \u043a\u0430\u0441\u0430\u043d\u0438\u044f \u0438 \u043f\u0438\u0449\u0430\u043b\u043a\u0443. \u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0438\u0449\u0430\u043b\u043a\u0443 \u0438 \u0434\u0430\u0434\u0438\u043c \u043f\u043e\u0441\u0435\u0442\u0438\u0442\u0435\u043b\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0432\u043e\u043d\u0438\u0442\u044c \u0432 \u043d\u0435\u0451. \u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f Cylon.js \u0434\u0430\u0442\u0447\u0438\u043a \u043a\u0430\u0441\u0430\u043d\u0438\u044f \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0437\u043d\u043e\u0432\u0438\u0434\u043d\u043e\u0441\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0438. \u0410 \u043f\u0438\u0449\u0430\u043b\u043a\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u0434\u043e\u0431\u043d\u043e \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u0443, \u0442\u043e \u0435\u0441\u0442\u044c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u0438 \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0430.<\/p>\n<p>  \u041f\u0440\u0438\u043a\u043e\u0441\u043d\u043e\u0432\u0435\u043d\u0438\u0435 \u043a \u0434\u0430\u0442\u0447\u0438\u043a\u0443 \u043a\u0430\u0441\u0430\u043d\u0438\u044f \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 touch.on(\u201cpush\u201d). \u041c\u044b \u0432\u043a\u043b\u044e\u0447\u0438\u043c \u043f\u0438\u0449\u0430\u043b\u043a\u0443 \u0438 \u043f\u043e\u043a\u0430\u0436\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043d\u0430 \u0416\u041a \u044d\u043a\u0440\u0430\u043d\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/620\/098\/703\/6200987034b944069cb100466becd09d.jpg\"\/><\/p>\n<p>  \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0434\u0430\u0442\u0447\u0438\u043a \u043a\u0430\u0441\u0430\u043d\u0438\u044f \u0438 \u043f\u0438\u0449\u0430\u043b\u043a\u0443.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 main.js<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">&quot;use strict&quot;;   var cylon = require(&quot;cylon&quot;);   cylon.api({   host: &quot;0.0.0.0&quot;,   port: &quot;3000&quot;,   ssl: false });   cylon.robot({   name: &quot;doorbot&quot;,   connections: {     edison: { adaptor: &quot;intel-iot&quot; }   },   devices: {     \/\/ digital sensors     button: { driver: &quot;button&quot;,        pin: 2, connection: &quot;edison&quot; },     led:    { driver: &quot;led&quot;,           pin: 3, connection: &quot;edison&quot; },     buzzer: { driver: &quot;direct-pin&quot;,    pin: 7, connection: &quot;edison&quot; },     touch:  { driver: &quot;button&quot;,        pin: 8, connection: &quot;edison&quot; },     \/\/ i2c devices     screen: { driver: &quot;upm-jhd1313m1&quot;, connection: &quot;edison&quot; }   },   doorbell: function() {     var that = this;     that.buzzer.digitalWrite(1);     that.writeMessage(&quot;Doorbell pressed&quot;, &quot;green&quot;);     setTimeout(function() {       that.reset();     }, 1000);   },   writeMessage: function(message, color) {     var that = this;     var str = message.toString();     while (str.length &lt; 16) {       str = str + &quot; &quot;;     }     console.log(message);     that.screen.setCursor(0,0);     that.screen.write(str);     switch(color)     {       case &quot;red&quot;:         that.screen.setColor(255, 0, 0);         break;       case &quot;green&quot;:         that.screen.setColor(0, 255, 0);         break;       case &quot;blue&quot;:         that.screen.setColor(0, 0, 255);         break;       default:         that.screen.setColor(255, 255, 255);         break;     }   },   reset: function() {     this.writeMessage(&quot;Doorbot ready&quot;);     this.led.turnOff();     this.buzzer.digitalWrite(0);   },   work: function() {     var that = this;     that.reset();      that.button.on('push', function() {       that.led.turnOn();       that.writeMessage(&quot;Lights On&quot;, &quot;blue&quot;);     });       that.button.on('release', function() {       that.reset();     });      that.touch.on('push', function() {       that.doorbell();     });    } }).start();<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043a\u043e\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e <a href=\"https:\/\/github.com\/hybridgroup\/Using-Cylon.js-With-The-Intel-Edison-and-IoT-Starter-Kit\/blob\/master\/5.js\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>. \u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u0438\u043b\u0438 \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0432 \u0444\u0430\u0439\u043b \u00abmain.js\u00bb \u0432 \u043e\u043a\u043d\u0435 Intel\u00ae XDK IoT Edition, \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0432\u0435\u0441\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043a\u043e\u0434, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0438 \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0435\u0433\u043e \u043d\u0430 \u043f\u043b\u0430\u0442\u0443.<\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u043f\u0440\u0438\u043a\u043e\u0441\u043d\u0438\u0442\u0435\u0441\u044c \u043a \u0434\u0430\u0442\u0447\u0438\u043a\u0443 \u043a\u0430\u0441\u0430\u043d\u0438\u044f \u0438 \u043f\u043e\u0441\u043b\u0443\u0448\u0430\u0439\u0442\u0435, \u0447\u0442\u043e \u043f\u0438\u0449\u0430\u043b\u043a\u0430 \u043f\u043e\u0434\u0430\u0435\u0442 \u0441\u0438\u0433\u043d\u0430\u043b.<\/p>\n<h2><font color=\"#0071c5\">\u0427\u0430\u0441\u0442\u044c 6. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u0432\u0435\u0440\u0438<\/font><\/h2>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0430\u0442\u0447\u0438\u043a \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 (\u043f\u043e\u0442\u0435\u043d\u0446\u0438\u043e\u043c\u0435\u0442\u0440) \u0438 \u0441\u0435\u0440\u0432\u043e\u043c\u043e\u0442\u043e\u0440. \u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u043e\u043c\u043e\u0442\u043e\u0440, \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044f \u0438\u043c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u043e\u043c\u0435\u0442\u0440\u0430. \u041d\u0435\u0447\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u043c\u043a\u0430 \u0438\u043b\u0438 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u043a\u0430\u043c\u0435\u0440\u044b \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f. \u041d\u043e \u0440\u0430\u0434\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0449\u0451 \u043f\u0430\u0440\u0443 \u0434\u0435\u0442\u0430\u043b\u0435\u0439 \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430.<\/p>\n<p>  \u041f\u043e\u0442\u0435\u043d\u0446\u0438\u043e\u043c\u0435\u0442\u0440 \u044d\u0442\u043e \u0432\u0438\u0434 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440\u0430. \u041e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u044f\u0441\u044c \u043d\u0430 \u0442\u043e\u043c, \u043a\u0430\u043a \u0432\u044b \u0435\u0433\u043e \u043f\u043e\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0435, \u043e\u043d \u0432\u044b\u0434\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u0438\u043b\u0438 \u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435, \u043f\u043e\u0434\u043e\u0431\u043d\u043e \u0440\u0443\u0447\u043a\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0433\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u044c\u044e. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0440\u0435\u0433\u0443\u043b\u044f\u0442\u043e\u0440\u043e\u0432 \u0433\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u0438 \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u043e\u043c\u0435\u0442\u0440\u044b.<\/p>\n<p>  \u0421\u0435\u0440\u0432\u043e\u043c\u043e\u0442\u043e\u0440\u044b \u044d\u0442\u043e \u043e\u0441\u043e\u0431\u044b\u0439 \u0432\u0438\u0434 \u043c\u043e\u0442\u043e\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0432\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0432\u043f\u0435\u0440\u0435\u0434 \u0438 \u043d\u0430\u0437\u0430\u0434 \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435, \u043e\u0431\u044b\u0447\u043d\u043e 180 \u0433\u0440\u0430\u0434\u0443\u0441\u043e\u0432. \u0427\u0430\u0441\u0442\u043e \u043e\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u0440\u0430\u0434\u0438\u043e\u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u044f\u0445 \u0441\u0430\u043c\u043e\u043b\u0435\u0442\u043e\u0432 \u0438\u043b\u0438 \u043a\u043e\u0440\u0430\u0431\u043b\u0435\u0439, \u0447\u0442\u043e\u0431\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0443\u0433\u043b\u043e\u043c \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u0440\u0443\u043b\u044f. \u041e\u043d\u0438 \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0434\u043b\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u0437\u0430\u043c\u043a\u0430 \u043d\u0430 \u0434\u0432\u0435\u0440\u0438, \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043a\u0430\u043c\u0435\u0440\u044b \u0438 \u0442. \u0434.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/988\/558\/7e3\/9885587e36134b66ad03806fdb0cb85d.jpg\"\/><\/p>\n<p>  \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0441\u0435\u0440\u0432\u043e\u043c\u043e\u0442\u043e\u0440 \u0438 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u043e\u043c\u0435\u0442\u0440:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 main.js<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">&quot;use strict&quot;;   var cylon = require(&quot;cylon&quot;);   cylon.api({   host: &quot;0.0.0.0&quot;,   port: &quot;3000&quot;,   ssl: false });   cylon.robot({   name: &quot;doorbot&quot;,   connections: {     edison: { adaptor: &quot;intel-iot&quot; }   },   devices: {     \/\/ digital sensors     button: { driver: &quot;button&quot;,        pin: 2, connection: &quot;edison&quot; },     led:    { driver: &quot;led&quot;,           pin: 3, connection: &quot;edison&quot; },     servo:  { driver: &quot;servo&quot;,         pin: 5, connection: &quot;edison&quot; },     buzzer: { driver: &quot;direct-pin&quot;,    pin: 7, connection: &quot;edison&quot; },     touch:  { driver: &quot;button&quot;,        pin: 8, connection: &quot;edison&quot; },     \/\/ analog sensors     dial:   { driver: &quot;analogSensor&quot;,  pin: 0, connection: &quot;edison&quot; },     \/\/ i2c devices     screen: { driver: &quot;upm-jhd1313m1&quot;, connection: &quot;edison&quot; }   },   turnLock: function(val) {     var that = this;     var currentAngle = that.servo.currentAngle();     var angle = val.fromScale(0, 1023).toScale(0,180) | 0;     if (angle &lt;= currentAngle - 3 || angle &gt;= currentAngle + 3) {       console.log(&quot;turning lock:&quot;, angle);       that.servo.angle(angle);     }   },   doorbell: function() {     var that = this;     that.buzzer.digitalWrite(1);     that.writeMessage(&quot;Doorbell pressed&quot;, &quot;green&quot;);     setTimeout(function() {       that.reset();     }, 1000);   },   writeMessage: function(message, color) {     var that = this;     var str = message.toString();     while (str.length &lt; 16) {       str = str + &quot; &quot;;     }     console.log(message);     that.screen.setCursor(0,0);     that.screen.write(str);     switch(color)     {       case &quot;red&quot;:         that.screen.setColor(255, 0, 0);         break;       case &quot;green&quot;:         that.screen.setColor(0, 255, 0);         break;       case &quot;blue&quot;:         that.screen.setColor(0, 0, 255);         break;       default:         that.screen.setColor(255, 255, 255);         break;     }   },   reset: function() {     this.writeMessage(&quot;Doorbot ready&quot;);     this.led.turnOff();     this.buzzer.digitalWrite(0);   },   work: function() {     var that = this;     that.reset();      that.button.on('push', function() {       that.led.turnOn();       that.writeMessage(&quot;Lights On&quot;, &quot;blue&quot;);     });       that.button.on('release', function() {       that.reset();     });      that.dial.on('analogRead', function(val) {       that.turnLock(val);     });       that.touch.on('push', function() {       that.doorbell();     });    } }).start();<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043a\u043e\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e <a href=\"https:\/\/github.com\/hybridgroup\/Using-Cylon.js-With-The-Intel-Edison-and-IoT-Starter-Kit\/blob\/master\/6.js\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>. \u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u0438\u043b\u0438 \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0432 \u0444\u0430\u0439\u043b \u00abmain.js\u00bb \u0432 \u043e\u043a\u043d\u0435 Intel\u00ae XDK IoT Edition, \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0432\u0435\u0441\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043a\u043e\u0434, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0438 \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0435\u0433\u043e \u043d\u0430 \u043f\u043b\u0430\u0442\u0443.<\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u043f\u043e\u0432\u0435\u0440\u043d\u0438\u0442\u0435 \u0440\u0443\u0447\u043a\u0443 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430 \u0441\u0435\u0440\u0432\u043e\u043c\u043e\u0442\u043e\u0440.<\/p>\n<h2><font color=\"#0071c5\">\u0427\u0430\u0441\u0442\u044c 7. \u041f\u043e\u0436\u0430\u0440\u043d\u0430\u044f \u0442\u0440\u0435\u0432\u043e\u0433\u0430<\/font><\/h2>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0430\u0442\u0447\u0438\u043a \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b. \u041d\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u0435\u0442\u0438\u0442\u0435\u043b\u0438 \u0431\u0443\u0434\u0443\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0443 \u0443\u043c\u043d\u0443\u044e \u0434\u0432\u0435\u0440\u044c. \u041c\u044b \u0442\u0430\u043a\u0436\u0435 \u0445\u043e\u0442\u0438\u043c \u0443\u043c\u0435\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0436\u0430\u0440 \u043e\u0442 \u043e\u0433\u043d\u044f \u0438 \u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0437\u0432\u0443\u043a\u043e\u0432\u0443\u044e \u0441\u0438\u0433\u043d\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u0436\u0430\u0440\u0430 \u0432\u044b \u0431\u044b \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0434\u0432\u0435\u0440\u044c, \u0435\u0441\u043b\u0438 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0435\u0451 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043f\u044b\u043b\u0430\u0435\u0442 \u043e\u0433\u043e\u043d\u044c. <\/p>\n<p>  \u0414\u0430\u0442\u0447\u0438\u043a \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 UMP, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0432 Cylon.js. UPM \u044d\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 Intel, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432. \u041e\u0434\u0438\u043d \u0438\u0437 \u043d\u0438\u0445 \u044d\u0442\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u043d\u0430\u0448 \u0434\u0430\u0442\u0447\u0438\u043a \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u00abGrove \u2014 Temperature Sensor\u00bb.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/016\/8cc\/652\/0168cc652ac54f56b28833604d8e496c.jpg\"\/><\/p>\n<p>  \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0434\u0430\u0442\u0447\u0438\u043a \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 main.js<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">&quot;use strict&quot;;   var cylon = require(&quot;cylon&quot;);   cylon.api({   host: &quot;0.0.0.0&quot;,   port: &quot;3000&quot;,   ssl: false });   cylon.robot({   name: &quot;doorbot&quot;,   connections: {     edison: { adaptor: &quot;intel-iot&quot; }   },   devices: {     \/\/ digital sensors     button: { driver: &quot;button&quot;,        pin: 2, connection: &quot;edison&quot; },     led:    { driver: &quot;led&quot;,           pin: 3, connection: &quot;edison&quot; },     servo:  { driver: &quot;servo&quot;,         pin: 5, connection: &quot;edison&quot; },     buzzer: { driver: &quot;direct-pin&quot;,    pin: 7, connection: &quot;edison&quot; },     touch:  { driver: &quot;button&quot;,        pin: 8, connection: &quot;edison&quot; },     \/\/ analog sensors     dial:   { driver: &quot;analogSensor&quot;,  pin: 0, connection: &quot;edison&quot; },     temp:   { driver: &quot;upm-grovetemp&quot;, pin: 1, connection: &quot;edison&quot; },     \/\/ i2c devices     screen: { driver: &quot;upm-jhd1313m1&quot;, connection: &quot;edison&quot; }   },   fireAlarm: function() {     var that = this;     var deg = that.temp.value();     console.log(&quot;current temp:&quot;, deg);     if (deg &gt;= 30) {       that.writeMessage(&quot;Fire alarm!&quot;, &quot;red&quot;);       that.buzzer.digitalWrite(1);       setTimeout(function() {         that.buzzer.digitalWrite(0);       }, 200);     }   },   turnLock: function(val) {     var that = this;     var currentAngle = that.servo.currentAngle();     var angle = val.fromScale(0, 1023).toScale(0,180) | 0;     if (angle &lt;= currentAngle - 3 || angle &gt;= currentAngle + 3) {       console.log(&quot;turning lock:&quot;, angle);       that.servo.angle(angle);     }   },   doorbell: function() {     var that = this;     that.buzzer.digitalWrite(1);     that.writeMessage(&quot;Doorbell pressed&quot;, &quot;green&quot;);     setTimeout(function() {       that.reset();     }, 1000);   },   writeMessage: function(message, color) {     var that = this;     var str = message.toString();     while (str.length &lt; 16) {       str = str + &quot; &quot;;     }     console.log(message);     that.screen.setCursor(0,0);     that.screen.write(str);     switch(color)     {       case &quot;red&quot;:         that.screen.setColor(255, 0, 0);         break;       case &quot;green&quot;:         that.screen.setColor(0, 255, 0);         break;       case &quot;blue&quot;:         that.screen.setColor(0, 0, 255);         break;       default:         that.screen.setColor(255, 255, 255);         break;     }   },   reset: function() {     this.writeMessage(&quot;Doorbot ready&quot;);     this.led.turnOff();     this.buzzer.digitalWrite(0);   },   work: function() {     var that = this;     that.reset();      that.button.on('push', function() {       that.led.turnOn();       that.writeMessage(&quot;Lights On&quot;, &quot;blue&quot;);     });       that.button.on('release', function() {       that.reset();     });      that.dial.on('analogRead', function(val) {       that.turnLock(val);     });       that.touch.on('push', function() {       that.doorbell();     });       setInterval(function() {       that.fireAlarm();     }, 1000);   } }).start();<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043a\u043e\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e <a href=\"https:\/\/github.com\/hybridgroup\/Using-Cylon.js-With-The-Intel-Edison-and-IoT-Starter-Kit\/blob\/master\/7.js\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>. \u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u0438\u043b\u0438 \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0432 \u0444\u0430\u0439\u043b \u00abmain.js\u00bb \u0432 \u043e\u043a\u043d\u0435 Intel\u00ae XDK IoT Edition, \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0432\u0435\u0441\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043a\u043e\u0434, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0438 \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0435\u0433\u043e \u043d\u0430 \u043f\u043b\u0430\u0442\u0443.<\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043a\u043e\u0434 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435.<\/p>\n<h2><font color=\"#0071c5\">\u0427\u0430\u0441\u0442\u044c 8. \u041e\u0445\u0440\u0430\u043d\u043d\u0430\u044f \u0441\u0438\u0433\u043d\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/font><\/h2>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0432\u0443\u043a\u043e\u0432\u043e\u0439 \u0434\u0430\u0442\u0447\u0438\u043a. \u0415\u0441\u043b\u0438 \u043a\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0438\u043b\u0438 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0441\u044f \u043a \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0434\u0432\u0435\u0440\u0438, \u0442\u043e \u043d\u0430\u0448\u0430 \u0443\u043c\u043d\u0430\u044f \u0434\u0432\u0435\u0440\u044c \u0441\u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u0448\u0443\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0437\u0432\u0443\u043a\u043e\u0432\u043e\u0439 \u0434\u0430\u0442\u0447\u0438\u043a, \u0438 \u0432\u043a\u043b\u044e\u0447\u0438\u0442 \u0441\u0432\u0435\u0442. \u0417\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u0430 \u043e\u0442\u043f\u0443\u0433\u043d\u0451\u043c, \u0430 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u043d\u044b\u0435 \u0433\u043e\u0441\u0442\u0438 \u0441\u043c\u043e\u0433\u0443\u0442 \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u0439\u0442\u0438 \u0434\u0432\u0435\u0440\u043d\u043e\u0439 \u0437\u0432\u043e\u043d\u043e\u043a.<\/p>\n<p>  \u0417\u0432\u0443\u043a\u043e\u0432\u043e\u0439 \u0441\u0435\u043d\u0441\u043e\u0440 \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430 \u044d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u043e\u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e. \u041f\u043e\u0434\u043e\u0431\u043d\u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u043e\u043c\u0435\u0442\u0440\u0443, \u043e\u043d \u0432\u044b\u0434\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0442 0 \u0434\u043e 1023. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0433\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u044c \u0437\u0432\u0443\u043a\u0430, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c\u0430\u044f \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u043c, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u044e \u043d\u0430 \u0435\u0433\u043e \u0432\u044b\u0445\u043e\u0434\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/e05\/098\/73c\/e0509873c9014ad893d10dcfbf044e35.jpg\"\/><\/p>\n<p>  \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0437\u0432\u0443\u043a\u043e\u0432\u043e\u0439 \u0434\u0430\u0442\u0447\u0438\u043a.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 main.js<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">&quot;use strict&quot;;   var cylon = require(&quot;cylon&quot;);   cylon.api({   host: &quot;0.0.0.0&quot;,   port: &quot;3000&quot;,   ssl: false });   cylon.robot({   name: &quot;doorbot&quot;,   connections: {     edison: { adaptor: &quot;intel-iot&quot; }   },   devices: {     \/\/ digital sensors     button: { driver: &quot;button&quot;,        pin: 2, connection: &quot;edison&quot; },     led:    { driver: &quot;led&quot;,           pin: 3, connection: &quot;edison&quot; },     servo:  { driver: &quot;servo&quot;,         pin: 5, connection: &quot;edison&quot; },     buzzer: { driver: &quot;direct-pin&quot;,    pin: 7, connection: &quot;edison&quot; },     touch:  { driver: &quot;button&quot;,        pin: 8, connection: &quot;edison&quot; },     \/\/ analog sensors     dial:   { driver: &quot;analogSensor&quot;,  pin: 0, connection: &quot;edison&quot; },     temp:   { driver: &quot;upm-grovetemp&quot;, pin: 1, connection: &quot;edison&quot; },     sound:  { driver: &quot;analogSensor&quot;,  pin: 2, connection: &quot;edison&quot; },     \/\/ i2c devices     screen: { driver: &quot;upm-jhd1313m1&quot;, connection: &quot;edison&quot; }   },   fireAlarm: function() {     var that = this;     var deg = that.temp.value();     console.log(&quot;current temp:&quot;, deg);     if (deg &gt;= 30) {       that.writeMessage(&quot;Fire alarm!&quot;, &quot;red&quot;);       that.buzzer.digitalWrite(1);       setTimeout(function() {         that.buzzer.digitalWrite(0);       }, 200);     }   },   detectSound: function(val) {     var that = this;     if (val &gt;= 450) {       console.log(&quot;Sound detected:&quot;, val)       that.writeMessage(&quot;Sound detected&quot;, &quot;blue&quot;);       that.led.turnOn();       setTimeout(function() {         that.reset();       }, 500);     }   },   turnLock: function(val) {     var that = this;     var currentAngle = that.servo.currentAngle();     var angle = val.fromScale(0, 1023).toScale(0,180) | 0;     if (angle &lt;= currentAngle - 3 || angle &gt;= currentAngle + 3) {       console.log(&quot;turning lock:&quot;, angle);       that.servo.angle(angle);     }   },   doorbell: function() {     var that = this;     that.buzzer.digitalWrite(1);     that.writeMessage(&quot;Doorbell pressed&quot;, &quot;green&quot;);     setTimeout(function() {       that.reset();     }, 1000);   },   writeMessage: function(message, color) {     var that = this;     var str = message.toString();     while (str.length &lt; 16) {       str = str + &quot; &quot;;     }     console.log(message);     that.screen.setCursor(0,0);     that.screen.write(str);     switch(color)     {       case &quot;red&quot;:         that.screen.setColor(255, 0, 0);         break;       case &quot;green&quot;:         that.screen.setColor(0, 255, 0);         break;       case &quot;blue&quot;:         that.screen.setColor(0, 0, 255);         break;       default:         that.screen.setColor(255, 255, 255);         break;     }   },   reset: function() {     this.writeMessage(&quot;Doorbot ready&quot;);     this.led.turnOff();     this.buzzer.digitalWrite(0);   },   work: function() {     var that = this;     that.reset();      that.button.on('push', function() {       that.led.turnOn();       that.writeMessage(&quot;Lights On&quot;, &quot;blue&quot;);     });       that.button.on('release', function() {       that.reset();     });      that.dial.on('analogRead', function(val) {       that.turnLock(val);     });       that.sound.on('analogRead', function(val) {       that.detectSound(val);     });       that.touch.on('push', function() {       that.doorbell();     });       setInterval(function() {       that.fireAlarm();     }, 1000);   } }).start();<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043a\u043e\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e <a href=\"https:\/\/github.com\/hybridgroup\/Using-Cylon.js-With-The-Intel-Edison-and-IoT-Starter-Kit\/blob\/master\/8.js\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>. \u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u0438\u043b\u0438 \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0432 \u0444\u0430\u0439\u043b \u00abmain.js\u00bb \u0432 \u043e\u043a\u043d\u0435 Intel\u00ae XDK IoT Edition, \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0432\u0435\u0441\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043a\u043e\u0434, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0438 \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0435\u0433\u043e \u043d\u0430 \u043f\u043b\u0430\u0442\u0443.<\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u043f\u043e\u0448\u0443\u043c\u0438\u0442\u0435 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435, \u0447\u0442\u043e \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0441\u044f.<\/p>\n<h1><font color=\"#0071c5\">\u0427\u0430\u0441\u0442\u044c 9. \u041e\u0445\u0440\u0430\u043d\u043d\u0430\u044f \u0441\u0438\u0433\u043d\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f (\u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435)<\/font><\/h1>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0430\u0442\u0447\u0438\u043a \u043e\u0441\u0432\u0435\u0449\u0435\u043d\u0438\u044f. \u041a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u043c \u0437\u0432\u0443\u043a\u0430, \u0435\u0441\u043b\u0438 \u043a\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u043a \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0434\u0432\u0435\u0440\u0438 \u043d\u043e\u0447\u044c\u044e, \u0442\u043e \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0441\u0432\u0435\u0442\u0430 \u0438 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043e\u0441\u0432\u0435\u0449\u0435\u043d\u0438\u0435 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. \u0415\u0449\u0451 \u0440\u0430\u0437, \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u0430 \u043e\u0442\u043f\u0443\u0433\u043d\u0451\u043c, \u0430 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u043d\u044b\u0435 \u0433\u043e\u0441\u0442\u0438 \u0441\u043c\u043e\u0433\u0443\u0442 \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u0439\u0442\u0438 \u0434\u0432\u0435\u0440\u043d\u043e\u0439 \u0437\u0432\u043e\u043d\u043e\u043a.<\/p>\n<p>  \u0414\u0430\u0442\u0447\u0438\u043a \u043e\u0441\u0432\u0435\u0449\u0435\u043d\u0438\u044f \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430 \u044d\u0442\u043e \u0435\u0449\u0451 \u043e\u0434\u043d\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0433\u043e \u043a\u043e\u0434 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u0435\u043d \u043a\u043e\u0434\u0443 \u0437\u0432\u0443\u043a\u043e\u0432\u043e\u0433\u043e \u0441\u0435\u043d\u0441\u043e\u0440\u0430.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/012\/19d\/837\/01219d8371c54af08a99a2badee26aeb.jpg\"\/><\/p>\n<p>  \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0434\u0430\u0442\u0447\u0438\u043a \u043e\u0441\u0432\u0435\u0449\u0435\u043d\u0438\u044f.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 main.js<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">&quot;use strict&quot;;   var cylon = require(&quot;cylon&quot;);   cylon.api({   host: &quot;0.0.0.0&quot;,   port: &quot;3000&quot;,   ssl: false });   cylon.robot({   name: &quot;doorbot&quot;,   connections: {     edison: { adaptor: &quot;intel-iot&quot; }   },   devices: {     \/\/ digital sensors     button: { driver: &quot;button&quot;,        pin: 2, connection: &quot;edison&quot; },     led:    { driver: &quot;led&quot;,           pin: 3, connection: &quot;edison&quot; },     servo:  { driver: &quot;servo&quot;,         pin: 5, connection: &quot;edison&quot; },     buzzer: { driver: &quot;direct-pin&quot;,    pin: 7, connection: &quot;edison&quot; },     touch:  { driver: &quot;button&quot;,        pin: 8, connection: &quot;edison&quot; },     \/\/ analog sensors     dial:   { driver: &quot;analogSensor&quot;,  pin: 0, connection: &quot;edison&quot; },     temp:   { driver: &quot;upm-grovetemp&quot;, pin: 1, connection: &quot;edison&quot; },     sound:  { driver: &quot;analogSensor&quot;,  pin: 2, connection: &quot;edison&quot; },     light:  { driver: &quot;analogSensor&quot;,  pin: 3, connection: &quot;edison&quot; },     \/\/ i2c devices     screen: { driver: &quot;upm-jhd1313m1&quot;, connection: &quot;edison&quot; }   },   fireAlarm: function() {     var that = this;     var deg = that.temp.value();     console.log(&quot;current temp:&quot;, deg);     if (deg &gt;= 30) {       that.writeMessage(&quot;Fire alarm!&quot;, &quot;red&quot;);       that.buzzer.digitalWrite(1);       setTimeout(function() {         that.buzzer.digitalWrite(0);       }, 200);     }   },   detectSound: function(val) {     var that = this;     if (val &gt;= 450) {       console.log(&quot;Sound detected:&quot;, val)       that.writeMessage(&quot;Sound detected&quot;, &quot;blue&quot;);       that.led.turnOn();       setTimeout(function() {         that.reset();       }, 500);     }   },   detectLight: function(val) {     var that = this;     var date = new Date();     var currentHour = date.getHours();     if (currentHour &gt; 19 && currentHour &lt; 8 && val &gt;= 450) {       console.log(&quot;Light detected:&quot;, val)       that.writeMessage(&quot;Light detected&quot;, &quot;blue&quot;);       that.led.turnOn();       setTimeout(function() {         that.reset();       }, 500);     }   },   turnLock: function(val) {     var that = this;     var currentAngle = that.servo.currentAngle();     var angle = val.fromScale(0, 1023).toScale(0,180) | 0;     if (angle &lt;= currentAngle - 3 || angle &gt;= currentAngle + 3) {       console.log(&quot;turning lock:&quot;, angle);       that.servo.angle(angle);     }   },   doorbell: function() {     var that = this;     that.buzzer.digitalWrite(1);     that.writeMessage(&quot;Doorbell pressed&quot;, &quot;green&quot;);     setTimeout(function() {       that.reset();     }, 1000);   },   writeMessage: function(message, color) {     var that = this;     var str = message.toString();     while (str.length &lt; 16) {       str = str + &quot; &quot;;     }     console.log(message);     that.screen.setCursor(0,0);     that.screen.write(str);     switch(color)     {       case &quot;red&quot;:         that.screen.setColor(255, 0, 0);         break;       case &quot;green&quot;:         that.screen.setColor(0, 255, 0);         break;       case &quot;blue&quot;:         that.screen.setColor(0, 0, 255);         break;       default:         that.screen.setColor(255, 255, 255);         break;     }   },   reset: function() {     this.writeMessage(&quot;Doorbot ready&quot;);     this.led.turnOff();     this.buzzer.digitalWrite(0);   },   work: function() {     var that = this;     that.reset();      that.button.on('push', function() {       that.led.turnOn();       that.writeMessage(&quot;Lights On&quot;, &quot;blue&quot;);     });       that.button.on('release', function() {       that.reset();     });      that.dial.on('analogRead', function(val) {       that.turnLock(val);     });       that.sound.on('analogRead', function(val) {       that.detectSound(val);     });      that.light.on('analogRead', function(val) {       that.detectLight(val);     });       that.touch.on('push', function() {       that.doorbell();     });       setInterval(function() {       that.fireAlarm();     }, 1000);   } }).start();<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043a\u043e\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e <a href=\"https:\/\/github.com\/hybridgroup\/Using-Cylon.js-With-The-Intel-Edison-and-IoT-Starter-Kit\/blob\/master\/9.js\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>. \u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u0438\u043b\u0438 \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0432 \u0444\u0430\u0439\u043b \u00abmain.js\u00bb \u0432 \u043e\u043a\u043d\u0435 Intel\u00ae XDK IoT Edition, \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0432\u0435\u0441\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043a\u043e\u0434, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0438 \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0435\u0433\u043e \u043d\u0430 \u043f\u043b\u0430\u0442\u0443.<\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u043e\u0441\u0432\u0435\u0442\u0438\u0442\u0435 \u0434\u0430\u0442\u0447\u0438\u043a \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435, \u0447\u0442\u043e \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0441\u044f.<\/p>\n<h2><font color=\"#0071c5\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/font><\/h2>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Cylon.js \u0441 \u043f\u043b\u0430\u0442\u043e\u0439 Intel Edison \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u0441\u0435 \u0434\u0435\u0442\u0430\u043b\u0438 \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430 Intel\u00ae IoT Developer Kit, \u043a\u0440\u043e\u043c\u0435 \u0440\u0435\u043b\u0435. \u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u043d\u0443\u044e, \u043c\u0438\u043d\u0438\u0430\u0442\u044e\u0440\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0443\u043c\u043d\u043e\u0439 \u0434\u0432\u0435\u0440\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/p>\n<p>  \u041f\u043b\u0430\u0442\u0430 Intel Edison \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043c\u043e\u0449\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u0440\u0438 \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u0435. \u0418 \u043c\u044b \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043d\u0430 \u0432\u0435\u0440\u0445\u0443\u0448\u043a\u0443 \u0435\u0451 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f Cylon.js \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0443\u043c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u043f\u043e\u043a\u043e\u043b\u0435\u043d\u0438\u044f. \u0410 \u0447\u0442\u043e \u0432\u044b \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0435\u0442\u0435 \u0441\u0430\u043c\u0438?<\/p>\n<p>  \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043d\u0430\u0431\u043e\u0440\u043e\u043c Intel IoT Developer Kit \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e <a href=\"http:\/\/habrahabr.ru\/company\/intel\/blog\/260259\/\">\u0418\u043d\u0433\u0440\u0435\u0434\u0438\u0435\u043d\u0442\u044b IoT \u0434\u0435\u043b\u0438\u043a\u0430\u0442\u0435\u0441\u043e\u0432 \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043f\u0440\u0438\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u0438\u044f: Intel Edison + Intel XDK + JavaScript + Grove Kit<\/a>   \t<\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/geektimes.ru\/post\/261094\/\"> http:\/\/geektimes.ru\/post\/261094\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       Intel Edison \u044d\u0442\u043e \u043d\u043e\u0432\u044b\u0439 \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u0434\u043d\u043e\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440. \u0421 \u0434\u0432\u0443\u0445\u044a\u044f\u0434\u0435\u0440\u043d\u044b\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u043c, \u043f\u043e\u0440\u0442\u0430\u043c\u0438 \u0432\u0432\u043e\u0434\u0430-\u0432\u044b\u0432\u043e\u0434\u0430 \u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u043c\u0438, \u043f\u043b\u0430\u0442\u0430 Intel Edison \u0438\u043c\u0435\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b \u0434\u043b\u044f Physical computing (Physical computing \u2014 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f. \u0421\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u0432 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0435\u0435 \u0435\u043c\u0443 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438\u0437 \u043e\u043a\u0440\u0443\u0436\u0430\u044e\u0449\u0435\u0433\u043e \u043c\u0438\u0440\u0430 \u0438 \u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043d\u0435\u0451). \u0412\u043e\u0442 \u043f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043f\u043e\u043b\u043d\u0443\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0434\u043b\u044f \u043f\u043b\u0430\u0442\u044b Intel Edison \u0432 <a href=\"http:\/\/cylonjs.com\">Cylon.js<\/a>, \u043d\u0430\u0448 JavaScript-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u0434\u043b\u044f \u0440\u043e\u0431\u043e\u0442\u043e\u0432 \u0438 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430 \u0432\u0435\u0449\u0435\u0439 (IoT).<br \/>  \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u0442 \u043d\u043e\u0432\u0438\u0447\u043a\u0430\u043c \u0441 \u0447\u0435\u0433\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u0438 \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u043e\u043b\u043d\u043e\u043c\u0443 \u043d\u0430\u0431\u043e\u0440\u0443 \u0432\u0441\u0435\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439. \u041c\u044b \u043f\u043e\u043a\u0430\u0436\u0435\u043c \u0432\u0430\u043c, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Cylon.js \u043f\u043e\u0447\u0442\u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u043d\u0430\u0431\u043e\u0440 Intel IoT Developer Kit. \u0417\u0430\u043c\u0435\u0442\u044c\u0442\u0435, \u043c\u044b \u0441\u043a\u0430\u0437\u0430\u043b\u0438 \u00ab\u043f\u043e\u0447\u0442\u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0445\u00bb, \u043c\u044b \u043d\u0435 \u0441\u0442\u0430\u043b\u0438 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0440\u0435\u043b\u0435, \u0442.\u043a. \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e. \u0410 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0445 \u043e\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u044f \u0441 \u043f\u043b\u0430\u0442\u043e\u0439 Intel Edison, \u044d\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0442\u0435\u043c\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<p>  \u041f\u043b\u0430\u0442\u0430 Intel Edison, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u043e \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0451, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0432 \u043d\u0430\u0431\u043e\u0440\u0435:<\/p>\n<p>  <a href=\"http:\/\/geektimes.ru\/company\/intel\/blog\/261094\/\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/c86\/b50\/994\/c86b50994a2444e0a7448e4832d59169.jpg\" \/><\/div>\n<p><\/a>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-264722","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/264722","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=264722"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/264722\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=264722"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=264722"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=264722"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}