{"id":257993,"date":"2015-05-26T15:55:03","date_gmt":"2015-05-26T11:55:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=257993"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=257993","title":{"rendered":"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043b\u0430\u0442\u044b Intel Edison \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0446\u0432\u0435\u0442\u0430 \u0448\u0430\u0440\u0430 Orbotix Sphero \u043f\u0440\u0438 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u043d\u043e\u0432\u044b\u0445 \u0442\u0432\u0438\u0442\u043e\u0432"},"content":{"rendered":"<p>       \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Intel Edison, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 Twitter \u0438 \u043c\u0435\u043d\u044f\u0435\u0442 \u0446\u0432\u0435\u0442 \u0448\u0430\u0440\u0430 Orbotix Sphero, \u0435\u0441\u043b\u0438 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u0442\u0432\u0438\u0442 \u0441 \u0445\u044d\u0448\u0442\u0435\u0433\u043e\u043c <a href=\"https:\/\/twitter.com\/hashtag\/intelmaker\">#intelmaker<\/a>. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434 \u043d\u0430 \u043f\u043b\u0430\u0442\u0435 \u043f\u0440\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u0448\u0430\u0440\u0430 Sphero. <br \/>  <a name=\"habracut\"><\/a><br \/>  \u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0432 \u043e\u0431 Orbotix Sphero. \u042d\u0442\u043e \u0440\u043e\u0431\u043e\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0448\u0430\u0440, \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044c \u0438 \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u0430. \u0418\u043c \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0447\u0435\u0440\u0435\u0437 Bluetooth. \u0415\u0441\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0438\u0433\u0440\u044b \u0434\u043b\u044f \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441 \u043d\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442. <\/p>\n<p>  <iframe loading=\"lazy\" width=\"560\" height=\"349\" src=\"\/\/www.youtube.com\/embed\/1S5lUDvlu3A?wmode=opaque\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u0448\u0430\u0440\u0430 \u043c\u0435\u043d\u044f\u0442\u044c \u0446\u0432\u0435\u0442. \u0418\u0442\u0430\u043a, \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f:<\/p>\n<ul>\n<li>\u0428\u0430\u0440 Sphero.<\/li>\n<li>\u0410\u043a\u043a\u0430\u0443\u0442 \u043d\u0430 \u0422\u0432\u0438\u0442\u0435\u0440\u0435.<\/li>\n<li>\u041d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u0430\u044f \u043f\u043b\u0430\u0442\u0430 Intel\u00ae Edison. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0448\u0430\u0433\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0441\u044b\u043b\u043a\u0438:<br \/> \n<ul>\n<li><a href=\"https:\/\/software.intel.com\/en-us\/articles\/getting-started-with-the-intel-edison-board-on-windows\">Getting Started with the Intel\u00ae Edison board on Windows<\/a><\/li>\n<li><a href=\"https:\/\/software.intel.com\/en-us\/articles\/getting-started-with-the-intel-edison-board-on-linux\">Getting Started with the Intel\u00ae Edison board on Linux<\/a><\/li>\n<li><a href=\"https:\/\/software.intel.com\/en-us\/articles\/getting-started-with-the-intel-edison-board-on-mac\">Getting Started with the Intel\u00ae Edison Board on Mac<\/a><\/li>\n<\/ul>\n<\/li>\n<li>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0438 \u043f\u043e\u0434\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u043d\u044b\u0439 \u043a \u0432\u0430\u0448\u0435\u0439 \u043f\u043b\u0430\u0442\u0435 Intel\u00ae XDK IoT Edition. <a href=\"https:\/\/software.intel.com\/en-us\/articles\/getting-started-with-intel-xdk-iot-edition-on-intel-iot-platforms\">Getting Started with Intel\u00ae XDK IoT Edition on Intel\u00ae IoT Platforms.<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<h1><font color=\"#0071c5\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/font><\/h1>\n<p>  \u042d\u0442\u0430 \u0447\u0430\u0441\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0448\u0430\u0433\u0438 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 Intel XDK IoT Edition \u0441 \u043a\u043e\u0434\u043e\u043c \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0448\u0430\u0440\u0430 Sphero.<\/p>\n<p>  1. \u0412 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 Intel XDK IoT Edition \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u043a\u043b\u0430\u0434\u043a\u0443 \u00abProjects\u00bb. \u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u00abStart a New Project\u00bb.<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/f55\/d34\/1da\/f55d341da9f1440caefb16ea2d1c0a0f.png\"\/><\/p>\n<p>  2. \u0412 \u0441\u0435\u043a\u0446\u0438\u0438 \u00abInternet of Things Embedded Application\u00bb \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u00abTemplates\u00bb:<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/b44\/813\/f2a\/b44813f2a43c4266b4d9e21c5ef07dff.png\"\/><\/p>\n<p>  3. \u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043b\u044e\u0431\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u00abContinue\u00bb.<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/939\/513\/9ed\/9395139ed6cb4709b583157d2f933c50.png\"\/><\/p>\n<p>  4. \u0412 \u043f\u043e\u043b\u0435 \u00abName your Project\u00bb \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u0438\u043c\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u00abCreate\u00bb.<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/12d\/d22\/d66\/12dd22d66a8e4285aa21d82de087b89e.png\"\/><\/p>\n<p>  5. \u041e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u0432\u0430\u0448 \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. \u0411\u0443\u0434\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u0444\u0430\u0439\u043b main.js. \u0423\u0434\u0430\u043b\u0438\u0442\u0435 \u0432\u0441\u0435 \u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043a\u043e\u0434\u043e\u043c:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">main.js<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">var twitter = require('mtwitter'); var colors = require('colors'); var moment = require('moment'); var spheron = require('spheron'); var sphero = spheron.sphero(); var spheroPort = '\/dev\/rfcomm0'; var COLORS = spheron.toolbelt.COLORS;  var newMessage = false; var lastTweet = '21:35:5';  var twit = new twitter({     consumer_key : 'xxxxxxxxxxxxxxxxxxxxx',     consumer_secret : 'xxxxxxxxxxxxxxxxxxxxx',     access_token_key : 'xxxxxxxxxxxxxxxxxxxxx',     access_token_secret : 'xxxxxxxxxxxxxxxxxxxxx' });  console.log('Starting'.cyan);  setInterval(function() {     twit.get('search\/tweets', {q: '#intelmaker'}, function(err, item) {         console.log(item.statuses[0].created_at.substring(11, 18).cyan)         console.log(lastTweet);         console.log(&quot;From isNew(): &quot;, newMessage);         if(item.statuses[0].created_at.substring(11, 18) === lastTweet) {             console.log(&quot;we here&quot;);             newMessage = false;         }         else{             newMessage = true             updateSphero(true);             lastTweet = item.statuses[0].created_at.substring(11, 18);         }     });  }, 1000);   function updateSphero(flag)  {     console.log('updating sphero');     sphero.on('open', function() {         sphero.setRGB(COLORS.RED, false);         setTimeout(function(){sphero.setRGB(COLORS.BLUE, false);}, 2000);     });      sphero.open(spheroPort);  }<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  6. \u041d\u0430 \u043b\u0435\u0432\u043e\u0439 \u043f\u0430\u043d\u0435\u043b\u0438 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0430\u0439\u043b package.json. \u0412 \u0441\u0435\u043a\u0446\u0438\u0438 \u00abdependencies\u00bb \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432\u0441\u0435 \u043c\u043e\u0434\u0443\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435:<\/p>\n<pre><code class=\"javascript\">&quot;dependencies&quot;: {                 &quot;mtwitter&quot;:&quot;latest&quot;,                 &quot;colors&quot;:&quot;latest&quot;,                 &quot;moment&quot;:&quot;latest&quot;,                 &quot;spheron&quot;:&quot;latest&quot;         }<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/939\/724\/087\/939724087ac048c6b409089f4816ae52.png\"\/><\/p>\n<h1><font color=\"#0071c5\">Twitter-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/font><\/h1>\n<p>  \u042d\u0442\u0430 \u0447\u0430\u0441\u0442\u044c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0448\u0430\u0433\u0438 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043d\u043e\u0432\u043e\u0433\u043e Twitter-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442 \u0432\u0430\u0448\u0435\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 \u0422\u0432\u0438\u0442\u0442\u0435\u0440\u043e\u043c.<\/p>\n<p>  1. \u0417\u0430\u0439\u0434\u0438\u0442\u0435 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0422\u0432\u0438\u0442\u0442\u0435\u0440\u0430 <a href=\"https:\/\/apps.twitter.com\/\">\u00abTwitter Apps\u00bb<\/a>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432\u0430\u0448 \u0442\u0432\u0438\u0442\u0442\u0435\u0440-\u0430\u043a\u043a\u0430\u0443\u043d\u0442. <\/p>\n<p>  2. \u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u00abCreate New App\u00bb. \u041e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/67f\/4ad\/cb7\/67f4adcb72b94370a11703eb8eeb361a.png\"\/><\/p>\n<p>  3. \u041d\u0430 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0441\u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<br \/>  a. \u0412 \u043f\u043e\u043b\u0435 \u00abName\u00bb \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u0438\u043c\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<br \/>  b. \u0412 \u043f\u043e\u043b\u0435 \u00abDescription\u00bb \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435.<br \/>  c. \u0412\u0432\u0435\u0434\u0438\u0442\u0435 URL \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u0430\u0439\u0442\u0430 \u0432 \u043f\u043e\u043b\u0435 \u00abWebsite\u00bb.<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/b24\/718\/c16\/b24718c160a54599bfb7bb4578c7fbd1.png\"\/><\/p>\n<p>  4. \u041f\u0440\u043e\u0447\u0438\u0442\u0430\u0439\u0442\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u0438 \u0435\u0441\u043b\u0438 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u044b, \u043e\u0442\u043c\u0435\u0442\u044c\u0442\u0435 \u00abYes, I agree\u00bb. \u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u00abCreate your Twitter Application\u00bb.<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/559\/d39\/16e\/559d3916e1524fbe86206fc916bb46e1.png\"\/><\/p>\n<p>  5. \u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u043d\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0443 \u00abKeys and Access Tokens\u00bb.<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/6ce\/00d\/cd8\/6ce00dcd8b0b4aafb2d81202744d9352.png\"\/><\/p>\n<p>  6. \u0412 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u00abApplication Settings\u00bb, \u0441\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043a\u043b\u044e\u0447 \u0438\u0437 \u043f\u043e\u043b\u044f Consumer Key (API Key) \u0438 \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0438\u0437 \u043f\u043e\u043b\u044f Consumer Secret (API Secret) \u0438 \u0432\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0438\u0445 \u0432 \u0432\u0430\u0448\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0411\u043b\u043e\u043a\u043d\u043e\u0442.<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/ab2\/594\/c79\/ab2594c79aa6422fb511b12dd35475a4.png\"\/><\/p>\n<p>  7. \u0412 \u0441\u0435\u043a\u0446\u0438\u0438 \u00abYour Access Token\u00bb \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u00abCreate my access token\u00bb.<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/0da\/2a6\/94d\/0da2a694d8bb4e209aed68cacc2979cd.png\"\/><\/p>\n<p>  8. \u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u0442\u043e\u043a\u0435\u043d \u0438\u0437 \u043f\u043e\u043b\u044f \u00abAccess Token\u00bb \u0438 \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0442\u043e\u043a\u0435\u043d \u0438\u0437 \u043f\u043e\u043b\u044f \u00abAccess Token Secret\u00bb \u0438 \u0432\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0432 \u0432\u0430\u0448\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u043e\u0432.<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/3e6\/524\/2f7\/3e65242f735b4b6ebae0797f05cca55e.png\"\/><\/p>\n<p>  9. \u0412 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 Intel XDK IoT Edition \u0432 \u0444\u0430\u0439\u043b\u0435 main.js \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043a \u0441\u0442\u0440\u043e\u043a\u0435, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 consumer_key. \u0412\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0435 \u043a\u043b\u044e\u0447\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u0440\u0430\u043d\u0435\u0435 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b\u0438, \u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 consumer_key, consumer_secret, access_token_key \u0438 access_token_secret.<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/e09\/7cf\/b40\/e097cfb401d3454dbca481a7368ed2c1.png\"\/><\/p>\n<h1><font color=\"#0071c5\">\u0421\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435<\/font><\/h1>\n<p>  \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043f\u043b\u0430\u0442\u0443 Edison \u043a Sphero, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f Bluetooth:<\/p>\n<p>  1. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u0441\u044c \u043a \u0432\u0430\u0448\u0435\u0439 \u043f\u043b\u0430\u0442\u0435 \u0447\u0435\u0440\u0435\u0437 \u043e\u043a\u043d\u043e \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430.<br \/>  2. \u0427\u0442\u043e\u0431\u044b \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c Bluetooth \u0438 \u043f\u0440\u043e\u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430, \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<pre><code class=\"bash\">rfkill unblock bluetooth bluetoothctl<\/code><\/pre>\n<p>  3. MAC-\u0430\u0434\u0440\u0435\u0441 \u0432\u0430\u0448\u0435\u0433\u043e Sphero \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043d\u0430 \u043d\u0438\u0436\u043d\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 XX-XX-XX-XX-XX-XX. \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 MAC-\u0430\u0434\u0440\u0435\u0441, \u0441\u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<br \/>  a. \u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code class=\"bash\">scan on<\/code><\/pre>\n<p>  b. \u041d\u0430\u0439\u0434\u0438\u0442\u0435 \u0432\u0430\u0448 Sphero \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0438 \u0441\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 MAC-\u0430\u0434\u0440\u0435\u0441.<br \/>  c. \u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code class=\"bash\">scan off<\/code><\/pre>\n<p>  4. \u0421\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u0435 \u0432\u0430\u0448\u0443 \u043f\u043b\u0430\u0442\u0443 \u0438 Sphero, \u0432\u0432\u0435\u0434\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<pre><code class=\"bash\">pair SpheroMacAddress exit rfcomm bind 0 SpheroMacAddress 1<\/code><\/pre>\n<p>  MAC-\u0430\u0434\u0440\u0435\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 XX:XX:XX:XX:XX:XX. \u042d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a Sphero.<\/p>\n<h1><font color=\"#0071c5\">\u0412\u044b\u0433\u0440\u0443\u0437\u043a\u0430 \u043a\u043e\u0434\u0430 \u043d\u0430 \u043f\u043b\u0430\u0442\u0443<\/font><\/h1>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u043f\u043b\u0430\u0442\u0443. \u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0448\u0430\u0433\u043e\u0432 \u0446\u0432\u0435\u0442 \u0432\u0430\u0448\u0435\u0433\u043e \u0448\u0430\u0440\u0430 Sphero \u0431\u0443\u0434\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0438 \u043d\u043e\u0432\u043e\u0433\u043e \u0442\u0432\u0438\u0442\u0430. \u0412 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 Intel XDK IoT Edition \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u0438\u043a\u043e\u043d\u043a\u0443 \u00abInstall\/Build\u00bb<img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/835\/7cc\/019\/8357cc019d5049629d220f814ef4bbed.png\"\/>. \u0415\u0441\u043b\u0438 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0434\u0430\u043d \u0432\u043e\u043f\u0440\u043e\u0441 \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438\u043b\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u00abupload or build\u00bb \u0432\u044b\u0431\u0438\u0440\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u00abBuild\u00bb.<\/p>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0435\u043a\u0442 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d, \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c. \u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u0438\u043a\u043e\u043d\u043a\u0443 \u00abUpload\u00bb <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/1e2\/fbf\/71b\/1e2fbf71ba304699aef3d7bf033b7082.png\"\/>, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 \u043f\u043b\u0430\u0442\u0443.<br \/>  \u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u0438\u043a\u043e\u043d\u043a\u0443 \u00abRun\u00bb <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/4f9\/aa0\/67d\/4f9aa067d7a54a2b867d727a8f94fe78.png\"\/>, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442. \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0430\u0448 Sphero \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c Twitter \u0440\u0430\u0437 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u0438 \u0437\u0430\u0436\u0438\u0433\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u0441\u0438\u043d\u0438\u043c, \u0435\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0442\u0432\u0438\u0442 \u0441 \u0445\u044d\u0448\u0442\u0435\u0433\u043e\u043c <a href=\"https:\/\/twitter.com\/hashtag\/intelmaker\">#intelmaker<\/a>.<\/p>\n<h1><font color=\"#0071c5\">\u0415\u0441\u043b\u0438 \u043d\u0435\u0442 \u0448\u0430\u0440\u0430 Sphero<\/font><\/h1>\n<p>  \u0414\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430: \u0435\u0441\u043b\u0438 \u043d\u0435\u0442 \u0448\u0430\u0440\u0430 Sphero, \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u0438\u0433\u0430\u043d\u0438\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u0430 \u043d\u0430 \u043f\u043b\u0430\u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u043a 13-\u043c\u0443 \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u043c\u0443 \u0432\u044b\u0432\u043e\u0434\u0443. \u0418 \u0447\u0442\u043e\u0431\u044b \u0447\u0430\u0449\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u044d\u0442\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u043a\u0430\u043a\u043e\u0433\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u0445\u044d\u0448\u0442\u0435\u0433\u0430 \u0438\u0437 Top\u2019\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"https:\/\/twitter.com\/hashtag\/gameinsight\">#gameinsight<\/a>.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">main.js<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">var twitter = require('mtwitter'); var mraa = require('mraa');  var lastTweet = 'XX:XX:XX';  var myOnboardLed = new mraa.Gpio(13); myOnboardLed.dir(mraa.DIR_OUT);  var twit = new twitter({     consumer_key : 'XXXXXXXXXXXXXXXXXXXXXXXXX',     consumer_secret : 'XXXXXXXXXXXXXXXXXXXXXXXXX',     access_token_key : 'XXXXXXXXXXXXXXXXXXXXXXXXX',     access_token_secret : 'XXXXXXXXXXXXXXXXXXXXXXXXX' });  console.log('Starting');  setInterval(function() {          console.log('--------------');          twit.get('search\/tweets', {q: '#gameinsight'}, function(err, item) {                if( item !== null )         {                                currTweetTime = item.statuses[0].created_at.substring(11, 18);                          if( currTweetTime !== lastTweet)             {                 console.log( 'Have new message: ' + item.statuses[0].text);                 lastTweet = currTweetTime;                 updateLed();              }         }     });       }, 1000);   function updateLed()  {        myOnboardLed.write(1);         setTimeout(function(){myOnboardLed.write(0);}, 500);   }<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0412 \u0444\u0430\u0439\u043b\u0435 package.json \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438:<\/p>\n<pre><code class=\"javascript\">&quot;dependencies&quot;: {     &quot;mtwitter&quot;:&quot;latest&quot; }<\/code><\/pre>\n<p>  <\/p>\n<h1><font color=\"#0071c5\">\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b:<\/font><\/h1>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/software.intel.com\/en-us\/articles\/getting-started-with-intel-xdk-iot-edition-on-intel-iot-platforms\">Getting Started with Intel\u00ae XDK IoT Edition on Intel\u00ae IoT Platforms<\/a><\/li>\n<li><a href=\"https:\/\/software.intel.com\/en-us\/html5\/xdk-iot\">Intel\u00ae XDK IoT Edition: Create, Test, and Deliver Internet of Things Solutions<\/a><\/li>\n<li><a href=\"https:\/\/software.intel.com\/en-us\/html5\/xdkdocs#537762\">Intel\u00ae XDK IoT Edition: Debug and Test Overview<\/a><\/li>\n<li><a href=\"https:\/\/software.intel.com\/en-us\/html5\/articles\/app-preview-overview\">An Introduction to Intel\u00ae App Preview Mobile App<\/a><\/li>\n<\/ul>\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:\/\/habrahabr.ru\/post\/258163\/\"> http:\/\/habrahabr.ru\/post\/258163\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Intel Edison, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 Twitter \u0438 \u043c\u0435\u043d\u044f\u0435\u0442 \u0446\u0432\u0435\u0442 \u0448\u0430\u0440\u0430 Orbotix Sphero, \u0435\u0441\u043b\u0438 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u0442\u0432\u0438\u0442 \u0441 \u0445\u044d\u0448\u0442\u0435\u0433\u043e\u043c <a href=\"https:\/\/twitter.com\/hashtag\/intelmaker\">#intelmaker<\/a>. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434 \u043d\u0430 \u043f\u043b\u0430\u0442\u0435 \u043f\u0440\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u0448\u0430\u0440\u0430 Sphero.   <\/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-257993","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/257993","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=257993"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/257993\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=257993"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=257993"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=257993"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}