{"id":208466,"date":"2014-01-09T07:53:02","date_gmt":"2014-01-09T03:53:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=208466"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=208466","title":{"rendered":"<span class=\"post_title\">\u0420\u041e\u0411\u041e\u0422 \u043d\u0430 \u0431\u0430\u0437\u0435: android, arduino, bluetooth. \u041d\u0430\u0447\u0430\u043b\u043e<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0440\u043e\u0431\u043e\u0442\u0430, \u0434\u0430\u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u043e\u0433\u043e \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u043e\u043c, \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0438 \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430. \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0430\u044f \u0440\u043e\u0431\u043e\u0442\u043e\u0442\u0435\u0445\u043d\u0438\u043a\u0430 \u043f\u0435\u0440\u0435\u0436\u0438\u0432\u0430\u0435\u0442 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0431\u0443\u043c, \u0435\u0439 \u043d\u0430\u0447\u0430\u043b\u0438 \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u0436\u0435 \u0442\u0435 \u043b\u044e\u0434\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u0438\u043a\u0438 \u043e\u0447\u0435\u043d\u044c \u0434\u0430\u043b\u0435\u043a\u0438 (\u043a \u043d\u0438\u043c \u043e\u0442\u043d\u043e\u0448\u0443\u0441\u044c \u0438 \u044f). \u041f\u0440\u043e\u0448\u043b\u043e \u0442\u043e \u0432\u0440\u0435\u043c\u044f, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u0438\u0434\u0435\u0442\u044c \u043d\u043e\u0447\u0430\u043c\u0438 \u0441 \u043f\u0430\u044f\u043b\u044c\u043d\u0438\u043a\u043e\u043c, \u0438\u043b\u0438 \u0442\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u043b\u0430\u0442\u044b. \u0412\u0441\u0435 \u0441\u0442\u0430\u043b\u043e \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435, \u043d\u0443\u0436\u043d\u043e \u043b\u0438\u0448\u044c \u043a\u0443\u043f\u0438\u0442\u044c Arduino, \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0442 \u043f\u0440\u043e\u0432\u043e\u0434\u043a\u043e\u0432, \u0441\u0435\u043d\u0441\u043e\u0440\u044b, \u0434\u0430\u0442\u0447\u0438\u043a\u0438, \u043c\u043e\u0442\u043e\u0440\u0447\u0438\u043a\u0438 \u0438 \u0432\u043f\u0435\u0440\u0435\u0434 \u043a \u0441\u0431\u043e\u0440\u043a\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u043e\u0431\u043e\u0442\u0430. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0444\u043e\u043a\u0443\u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u2014 \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u0435\u0439 \u0441\u043c\u0435\u0441\u0442\u0438\u043b\u0441\u044f \u0441 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u0438\u043a\u0438 \u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e.<br \/>  \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0435\u0440\u0438\u044f \u0441\u0442\u0430\u0442\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0441\u0442\u0430\u0440\u0442\u0430 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u043e\u0431\u043e\u0442\u0430, \u043e\u0442 \u043f\u043e\u043a\u0443\u043f\u043a\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u0435\u0442\u0430\u043b\u0435\u0439 \u0434\u043e \u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432 \u043d\u0430\u0448 \u043c\u0438\u0440. <br \/>  <a name=\"habracut\"><\/a><br \/>  \u041e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u0441\u0442\u0430\u0442\u044c\u0438 \u044f \u043f\u0438\u0448\u0443 \u043f\u043e \u0445\u043e\u0434\u0443 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u043e\u0431\u043e\u0442\u0430.<\/p>\n<p>  \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u0447\u0438\u0442\u0430\u044e\u0449\u0438\u0439 \u0441\u0442\u0430\u0442\u044c\u044e \u0443\u0436\u0435 \u0438\u043c\u0435\u0435\u0442 \u043e\u043f\u044b\u0442 \u0432:  <\/p>\n<ul>\n<li>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u0441\u0440\u0435\u0434\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u043b\u044f android \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432.<\/li>\n<li>\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043f\u0435\u0440\u0432\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b Hello World \u0434\u043b\u044f android \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430.<\/li>\n<li>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432 \u0438 \u0441\u0440\u0435\u0434\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u043b\u044f Arduino.<\/li>\n<li>\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043f\u0435\u0440\u0432\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b (\u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c, \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u044c) \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u044b \u043d\u0430 Arduino.<\/li>\n<\/ul>\n<h5>\u0421\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044f<\/h5>\n<p>  \u0411\u0422 \u2013 Bluetooth;<br \/>  \u0410\u043d\u0434\u0440\u043e\u0438\u0434 \u2013 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0441 \u041e\u0421 android, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d;<br \/>  \u0421\u043a\u0435\u0442\u0447 \u2013 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f Arduino;<br \/>  \u0410\u0440\u0434\u0443\u0438\u043d\u043e \u2013 Arduino Nano.<\/p>\n<h5>\u041e\u0431\u0449\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0440\u043e\u0431\u043e\u0442\u0430<\/h5>\n<p>  \u041f\u0443\u0441\u0442\u044c \u0440\u043e\u0431\u043e\u0442 \u0438\u043c\u0435\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043e\u0431\u0449\u0443\u044e \u0441\u0445\u0435\u043c\u0443 (\u0440\u0438\u0441.1). \u0410\u043d\u0434\u0440\u043e\u0438\u0434, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u00ab\u0433\u043e\u043b\u043e\u0432\u043d\u044b\u043c \u043c\u043e\u0437\u0433\u043e\u043c\u00bb, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043f\u0440\u043e\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f. \u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 \u043f\u043e \u0411\u0422 \u043a\u0430\u043d\u0430\u043b\u0443 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c\u044b\u0435 \u0411\u0422 \u043c\u043e\u0434\u0443\u043b\u0435\u043c \u0438 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u044e\u0449\u0438\u0435 \u043f\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c\u0443 \u043f\u043e\u0440\u0442\u0443 \u0432 Arduino. Arduino \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u0432\u0448\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0438\u0445 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u00ab\u043c\u044b\u0448\u0446\u00bb (\u041c\u043e\u0442\u043e\u0440\u044b \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u044b \u0438 \u0434\u0440.). \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e \u0432 Arduino \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u044e\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442 \u00ab\u043e\u0440\u0433\u0430\u043d\u043e\u0432 \u0447\u0443\u0432\u0441\u0442\u0432\u00bb (\u0441\u0435\u043d\u0441\u043e\u0440\u044b, \u0434\u0430\u0442\u0447\u0438\u043a\u0438 \u0438 \u0434\u0440.), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043d \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u0432 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0432\u0438\u0434 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0411\u0422 \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u00ab\u0433\u043e\u043b\u043e\u0432\u043d\u043e\u0439 \u043c\u043e\u0437\u0433\u00bb. \u0418 \u0442\u0430\u043a \u0432\u0441\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442 \u0434\u043e \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0441\u0442\u0438.<br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/ccb\/d06\/e02\/ccbd06e021c42746b2be4faa6396cb25.jpg\" alt=\"image\"\/><br \/>  \u0420\u0438\u0441\u0443\u043d\u043e\u043a 1<br \/>  \u041e\u0431\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0441\u0445\u0435\u043c\u044b \u0440\u043e\u0431\u043e\u0442\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<br \/>  -\u0411\u0422 \u043c\u043e\u0434\u0443\u043b\u044c \u0438 Arduino Nano \u0438\u043c\u0435\u044e\u0442 \u043d\u0438\u0437\u043a\u0443\u044e \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u043e\u0431\u044a\u0435\u043c \u0438 \u0432\u0435\u0441.<br \/>  -\u0410\u043d\u0434\u0440\u043e\u0438\u0434, \u043d\u0435 \u0434\u043e\u0440\u043e\u0433\u043e\u0435 \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e, \u0443\u0436\u0435 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0443 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043b\u044e\u0434\u0435\u0439, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0443 \u043c\u0435\u043d\u044f.<br \/>  -\u0410\u043d\u0434\u0440\u043e\u0438\u0434 \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0438 \u0441\u0435\u043d\u0441\u043e\u0440\u044b, \u0434\u0430\u0442\u0447\u0438\u043a\u0438 \u0438 \u044d\u043a\u0440\u0430\u043d \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438<br \/>  -\u041f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043a\u0430\u043a \u0434\u043b\u044f \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0430 \u0442\u0430\u043a \u0438 \u0434\u043b\u044f \u0430\u0440\u0434\u0443\u0438\u043d\u043e.<br \/>  \u0414\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0440\u043e\u0431\u043e\u0442\u0430, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u00ab\u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043a \u0441\u043b\u043e\u0436\u043d\u043e\u043c\u0443\u00bb, \u0442.\u0435. \u043a\u0430\u043a \u0438 \u043f\u0440\u0438 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0438 \u044f\u0437\u044b\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0435\u0440\u0432\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u00abHello word\u00bb. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u043e\u0434\u043d\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u0430 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0434\u0432\u0435 (\u0434\u043b\u044f \u0430\u0440\u0434\u0443\u0438\u043d\u043e \u0438 \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0430). \u0412 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0440\u043e\u0431\u043e\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f.<\/p>\n<h5>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438<\/h5>\n<p>  \u0421\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0438\u043c\u0435\u044e\u0442\u0441\u044f: <br \/>  -2 \u043a\u043d\u043e\u043f\u043a\u0438 (b1, b2).<br \/>  -1 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434 (Led). <br \/>  \u0418 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b: <br \/>  -\u0433\u043b\u0430\u0432\u043d\u043e\u0435 activity \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 2 \u043a\u043d\u043e\u043f\u043a\u0438 \u00ab\u041e\u0442\u043f\u0430\u0440\u0432\u0438\u0442\u044c 0\u00bb \u0438 \u00ab\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c 1\u00bb, \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442 \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0430 \u043a \u0430\u0440\u0434\u0443\u0438\u043d\u043e \u043f\u043e \u0411\u0422 \u043a\u0430\u043d\u0430\u043b\u0443 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043d\u043d\u043e \u00ab0\u00bb \u0438 \u00ab1\u00bb, \u0430\u0440\u0434\u0443\u0438\u043d\u043e \u0438\u0445 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0432\u0430\u0435\u0442 \u0438 \u0437\u0430\u0436\u0438\u0433\u0430\u0435\u0442 \u043b\u0438\u0431\u043e \u0442\u0443\u0448\u0438\u0442 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434.<br \/>  -\u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u0438\u043b\u0438 \u043e\u0442\u043f\u0443\u0441\u043a\u0430\u043d\u0438\u0438 \u043a\u043d\u043e\u043f\u043e\u043a \u043e\u0442 \u0430\u0440\u0434\u0443\u0438\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u0430\u043d\u0434\u0440\u043e\u0438\u0434, \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e activity \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431 \u044d\u0442\u043e\u043c. <\/p>\n<h5>\u0417\u0430\u043a\u0443\u043f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u0435\u0442\u0430\u043b\u0435\u0439 \u0438 \u0443\u0437\u043b\u043e\u0432.<\/h5>\n<p>  1) Android \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u2013 \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d LG P500 (\u0432\u0435\u0440\u0441\u0438\u044f Android 2.3.3), \u043b\u0438\u0431\u043e \u043b\u044e\u0431\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043d\u0430 \u0431\u0430\u0437\u0435 Android \u0432\u0435\u0440\u0441\u0438\u0435\u0439 2.3.3 \u0438 \u0432\u044b\u0448\u0435. \u0426\u0435\u043d\u0443 \u043d\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043d\u0435 \u043f\u043e\u043a\u0443\u043f\u0430\u043b, \u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0441\u0432\u043e\u0439 \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d.<br \/>  2) Arduino NanoV3.0 ( <a href=\"http:\/\/dx.com\/ru\/p\/nano-v3-0-avr-atmega328-p-20au-module-board-usb-cable-for-arduino-118037\">dx.com\/ru\/p\/nano-v3-0-avr-atmega328-p-20au-module-board-usb-cable-for-arduino-118037<\/a> ) \u2014 11,32$<br \/>  3) \u041c\u043e\u0434\u0443\u043b\u044c Bluetooth ( <a href=\"http:\/\/dx.com\/ru\/p\/bluetooth-board-module-4-pin-121326\">dx.com\/ru\/p\/bluetooth-board-module-4-pin-121326<\/a> ) \u2014 10,57$<br \/>  4) \u041c\u0430\u043a\u0435\u0442\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u0430 ( <a href=\"http:\/\/dx.com\/ru\/p\/30cm-breadboard-wires-for-electronic-diy-40-cable-pack-80207\">dx.com\/ru\/p\/30cm-breadboard-wires-for-electronic-diy-40-cable-pack-80207<\/a> ) \u2014 2,51$<br \/>  5) \u041a\u043d\u043e\u043f\u043a\u0438 \u2014 2\u0448\u0442., \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434 \u2013 1 \u0448\u0442. \u2013 50 \u0440\u0443\u0431\u043b\u0435\u0439<br \/>  \u0418\u0442\u043e\u0433\u043e: 855,20 \u0440\u0443\u0431\u043b\u0435\u0439.<\/p>\n<h4>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u0440\u0430\u0431\u043e\u0442\u0435<\/h4>\n<p>  <\/p>\n<h5>Arduino<\/h5>\n<p>  \u0421\u043e\u0431\u0435\u0440\u0435\u043c \u0438\u0437 \u0438\u043c\u0435\u044e\u0449\u0438\u0445\u0441\u044f \u0434\u0435\u0442\u0430\u043b\u0435\u0439 \u0441\u0445\u0435\u043c\u0443 (\u0440\u0438\u0441. 2)<br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/1d3\/0a7\/6b6\/1d30a76b6795549ad5163151cbfcbb0a.jpg\" alt=\"image\"\/><br \/>  \u0420\u0438\u0441\u0443\u043d\u043e\u043a 2<br \/>  \u041f\u0438\u0442\u0430\u043d\u0438\u0435 \u043d\u0430 arduino \u043f\u043e\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u043e USB \u043a\u0430\u0431\u0435\u043b\u044e, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0443, \u043f\u043e \u043d\u0435\u043c\u0443 \u0436\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435 (\u0441\u043a\u0435\u0442\u0447) \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0435 \u043d\u0430 \u043d\u0435\u043c. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0441\u043a\u0435\u0442\u0447 \u0432 arduino \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u043f\u0438\u0442\u0430\u043d\u0438\u0435 \u043e\u0442 Bluetooth \u043c\u043e\u0434\u0443\u043b\u044f (\u0412\u044b\u0432\u043e\u0434 (17) 3V3), \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430.<br \/>  \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u0440\u0435\u0434\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 Arduino \u0438 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435: <a href=\"http:\/\/arduino.ru\/Guide\/Windows\">arduino.ru\/Guide\/Windows<\/a> <br \/>  \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u0441\u043a\u0435\u0442\u0447 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432 \u0430\u0440\u0434\u0443\u0438\u043d\u043e:  <\/p>\n<pre><code class=\"cpp\">\/\/\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 int led = 12; \/\/ \u0421\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434 int b1 = 11; \/\/ \u041a\u043d\u043e\u043f\u043a\u0430 int b2 = 10; \/\/ \u041a\u043d\u043e\u043f\u043a\u0430 int value_1,value_2 = 0; \/\/ \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0440\u0435\u0431\u0435\u0437\u0433\u0430 \u043a\u043e\u043d\u0442\u0430\u043a char incomingbyte; \/\/ \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0434\u043b\u044f \u043f\u0440\u0438\u0435\u043c\u0430 \u0434\u0430\u043d\u043d\u044b\u0445  \/\/\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 void setup() {   Serial.begin(38400);   pinMode(led,OUTPUT);   digitalWrite(led, HIGH);   pinMode(b1,INPUT);   digitalWrite(b1, HIGH);     pinMode(b2,INPUT);   digitalWrite(b2, HIGH);   } \/\/\u041e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043a\u043d\u043e\u043f\u043e\u043a \u0438 \u0443\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u043c \u0434\u0440\u0435\u0431\u0435\u0437\u0433 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432 void contact_bounce(int buttton){   value_1 = digitalRead(buttton);   if (!value_1){     delay(80);     value_2 = digitalRead(buttton);     if (!value_2){        Serial.print(&quot;Press button b&quot;);         Serial.println(buttton);      }   } } \/\/\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0446\u0438\u043a\u043b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b void loop() {   if (Serial.available() &gt; 0){     incomingbyte = Serial.read();       if (incomingbyte == '1'){         digitalWrite(led,HIGH);         Serial.println(&quot;LED ON&quot;);       }       if (incomingbyte=='0'){         digitalWrite(led,LOW);         Serial.println(&quot;LED OFF&quot;);       }   }   contact_bounce(b1);   contact_bounce(b2); } <\/code><\/pre>\n<p>  \u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043d\u0430\u043f\u0440\u043e\u0442\u0438\u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u043e\u0438\u0442 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439.<br \/>  \u0418\u043d\u0438\u0446\u0438\u0438\u0440\u0443\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u0434\u0430\u0435\u043c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0431\u0438\u0442\/c (\u0431\u043e\u0434). \u041c\u043e\u0439 \u0411\u0422 \u043c\u043e\u0434\u0443\u043b\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 38400, \u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c 9600 (\u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0411\u0422 \u043c\u043e\u0434\u0443\u043b\u044f \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 AT \u043a\u043e\u043c\u0430\u043d\u0434). \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0440\u0435\u0436\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u0430\/\u0432\u044b\u0445\u043e\u0434\u0430(pin) \u043a\u0430\u043a \u0432\u0445\u043e\u0434\u0430 \u0438\u043b\u0438 \u043a\u0430\u043a \u0432\u044b\u0445\u043e\u0434\u0430. \u041f\u043e\u0434\u0430\u0435\u043c HIGH \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u0432\u0445\u043e\u0434\u044b \u0438 \u0432\u044b\u0445\u043e\u0434\u044b.<br \/>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f void contact_bounce(int buttton) \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043a\u043d\u043e\u043f\u043e\u043a \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u0440\u0435\u0431\u0435\u0437\u0433 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u0440\u0438 \u0441\u043e\u043f\u0440\u0438\u043a\u043e\u0441\u043d\u043e\u0432\u0435\u043d\u0438\u0438 \u0438\u043b\u0438 \u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0438 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432 \u0432 \u043c\u0435\u0445\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445, \u0442\u0430\u043a\u0438\u0445, \u043a\u0430\u043a \u043a\u043d\u043e\u043f\u043a\u0430, \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e\u0435 \u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u0435 \u0438 \u0440\u0430\u0437\u043c\u044b\u043a\u0430\u043d\u0438\u0435.<br \/>  \u0412 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435 Loop \u0441\u043b\u0443\u0448\u0430\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0440\u0442, \u0438 \u0435\u0441\u043b\u0438 \u043d\u0430 \u043d\u0435\u0433\u043e \u043f\u0440\u0438\u0448\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u044b \u0438\u0445 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043a\u043d\u043e\u043f\u043e\u043a \u0438 \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0440\u0435\u0431\u0435\u0437\u0433\u0430 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432.<br \/>  \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0432 \u0441\u043a\u0435\u0442\u0447 \u0432 \u0430\u0440\u0434\u0443\u0438\u043d\u043e, \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u2013 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0432 \u043c\u043e\u043d\u0438\u0442\u043e\u0440 \u043f\u043e\u0440\u0442\u0430. \u041f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043a\u043d\u043e\u043f\u043e\u043a \u0432 \u043e\u043a\u043d\u0435 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043d\u0430\u0434\u043f\u0438\u0441\u044c \u00abPress button b\u00bb. \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u0430 \u0443\u0434\u0430\u0441\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0430.<br \/>  \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0434\u043b\u044f \u0430\u0440\u0434\u0443\u0438\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e\u0442 \u0441\u043a\u0435\u0442\u0447.\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0430.<\/p>\n<h5>Android<\/h5>\n<p>  \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0430, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u00abAndroid virtual device\u00bb, \u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d \u0441 \u041e\u0421 Android \u0432\u0435\u0440\u0441\u0438\u0438 \u043e\u0442 2.3.3 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0439 \u0447\u0435\u0440\u0435\u0437 USB \u043a\u0430\u0431\u0435\u043b\u044c \u043a \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0443 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u00ab\u041e\u0442\u043b\u0430\u0434\u043a\u0438\u00bb. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0430\u0442\u0435\u0439 \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c.<\/p>\n<h5>Android \u0428\u0410\u0413 1 <\/h5>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u00abAndroid application project\u00bb<br \/>  \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0411\u0422 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0435\u0433\u043e \u043d\u0430\u0448\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442, \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0443 Permissions, \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c add, \u0434\u0430\u043b\u0435\u0435 Uses permission, \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0430\u0432\u0430: android.permission.BLUETOOTH, android.permission.BLUETOOTH_ADMIN<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0444\u043e\u0440\u043c\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 activity, \u0432 res\/layout\/activity_main.xml \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043c \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"xml\">&lt;LinearLayout xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;     android:layout_width=&quot;fill_parent&quot;     android:layout_height=&quot;fill_parent&quot;     android:orientation=&quot;vertical&quot; &gt;     &lt;LinearLayout         android:layout_width=&quot;match_parent&quot;         android:layout_height=&quot;wrap_content&quot; &gt;         &lt;Button             android:id=&quot;@+id\/b1&quot;             android:layout_width=&quot;wrap_content&quot;             android:layout_height=&quot;wrap_content&quot;             android:text=&quot;\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c &quot;0&quot;&quot; \/&gt;         &lt;Button             android:id=&quot;@+id\/b2&quot;             android:layout_width=&quot;wrap_content&quot;             android:layout_height=&quot;wrap_content&quot;             android:text=&quot;\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c &quot;1&quot;&quot; \/&gt;     &lt;\/LinearLayout&gt;     &lt;TextView         android:id=&quot;@+id\/txtrobot&quot;         android:layout_width=&quot;wrap_content&quot;         android:layout_height=&quot;wrap_content&quot;         android:text=&quot;\u041f\u043e\u043b\u0435 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439&quot; \/&gt; &lt;\/LinearLayout&gt; <\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 activity \u043f\u0440\u0438\u043c\u0435\u0442 \u0432\u0438\u0434:<br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/97a\/f68\/57a\/97af6857ad800a391001a77c4fe6a2ac.jpg\" alt=\"image\"\/><br \/>  \u0420\u0438\u0441\u0443\u043d\u043e\u043a 3<br \/>  \u0422\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u00abtxtrobot\u00bb, \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0432\u0441\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u043d\u0430\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e. \u041a\u043d\u043e\u043f\u043a\u0438 b1 \u0438 b2, \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 arduino.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 src\/..\/MainActivity.java \u0437\u0434\u0435\u0441\u044c \u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u0448 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u0434. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u043f\u0430\u043a\u0435\u0442 Api \u0434\u043b\u044f Bluetooth:  <\/p>\n<pre><code class=\"java\">import android.bluetooth.*; <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0411\u0422 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u0441\u044f, \u0447\u0442\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0435 \u043e\u043d \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 BluetoothAdapter (\u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0438\u0439 \u0437\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u0432 \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0435 \u0411\u0422 \u043c\u043e\u0434\u0443\u043b\u0435\u043c):  <\/p>\n<pre><code class=\"java\">btAdapter = BluetoothAdapter.getDefaultAdapter();   <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0430\u043d\u0434\u0440\u043e\u0438\u0434 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0411\u0422 \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u043e null:  <\/p>\n<pre><code class=\"java\">TextView mytext = (TextView) findViewById(R.id.txtrobot); if (btAdapter != null){         \tmytext.setText(&quot;Bluetooth \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442&quot;);\t\t\t }else {         \tmytext.setText(&quot;Bluetooth \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442&quot;); }  <\/code><\/pre>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0432\u0438\u0434\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c. \u041d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0430 \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043d\u0430\u0434\u043f\u0438\u0441\u044c: \u00abBluetooth \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442\u00bb.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0411\u0422 \u0432\u043a\u043b\u044e\u0447\u0435\u043d, \u043b\u0438\u0431\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c \u0435\u0433\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443:  <\/p>\n<pre><code class=\"java\">private static final int REQUEST_ENABLE_BT = 1; <\/code><\/pre>\n<p>  \u0438 \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"java\">if (btAdapter.isEnabled()){  \tmytext.setText(&quot;Bluetooth \u0432\u043a\u043b\u044e\u0447\u0435\u043d. \u0412\u0441\u0435 \u043e\u0442\u043b\u0438\u0447\u043d\u043e.&quot;);\t\t\t }else { Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);        \tstartActivityForResult(enableBtIntent, REQUEST_ENABLE_BT); }  <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0432 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0435, \u0412\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0434\u0430\u043d \u00ab\u0417\u0430\u043f\u0440\u043e\u0441 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f Bluetooth\u00bb, \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0432 \u0435\u0433\u043e, \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u0412\u044b \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u0442\u0435 \u0411\u0422.<br \/>  \u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:  <\/p>\n<pre><code class=\"java\">package com.robot.bluetest;  import android.os.Bundle; import android.app.Activity; import android.widget.TextView; import android.bluetooth.*; import android.content.Intent;  public class MainActivity extends Activity { \tprivate static final int REQUEST_ENABLE_BT = 0; \tpublic BluetoothAdapter btAdapter; \tpublic TextView mytext; \t @Override protected void onCreate(Bundle savedInstanceState) { \t\tsuper.onCreate(savedInstanceState); \t\tsetContentView(R.layout.activity_main); \t\t\t\t \t\tbtAdapter = BluetoothAdapter.getDefaultAdapter(); \t\tmytext = (TextView) findViewById(R.id.txtrobot);          \t         if (btAdapter != null){         \tif (btAdapter.isEnabled()){         \t\tmytext.setText(&quot;Bluetooth \u0432\u043a\u043b\u044e\u0447\u0435\u043d. \u0412\u0441\u0435 \u043e\u0442\u043b\u0438\u0447\u043d\u043e.&quot;);\t\t\t         \t}else         \t{         \t\tIntent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);         \t\tstartActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);         \t}         \t         }else         {         \tmytext.setText(&quot;Bluetooth \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442&quot;);         } \t} }  <\/code><\/pre>\n<h5>Android \u0428\u0410\u0413 2<\/h5>\n<p>  \u0414\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0445 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u00ab\u0441\u043f\u0430\u0440\u0438\u0442\u044c\u00bb \u043d\u0430\u0448 \u0430\u043d\u0434\u0440\u043e\u0438\u0434 \u0438 \u0411\u0422 \u043c\u043e\u0434\u0443\u043b\u044c, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430 \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0435 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0411\u0422, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043f\u043e\u0438\u0441\u043a \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c\u0441\u044f \u043a \u0411\u0422 \u043c\u043e\u0434\u0443\u043b\u044e, \u043f\u0430\u0440\u043e\u043b\u044c \u00ab1234\u00bb. <br \/>  \u0415\u0441\u043b\u0438 \u0432\u0434\u0440\u0443\u0433 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0411\u0422 \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u043e\u0442 \u043d\u0435\u0433\u043e \u0432\u0441\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u0430 (VCC, GND,RX,TX), \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u0441\u0434\u0435\u043b\u0430\u0432 \u0436\u0435\u0441\u0442\u043a\u0443\u044e \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443, \u0438 \u0441\u043d\u043e\u0432\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0438\u0445 \u2014 \u044d\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043c\u043e\u0447\u044c.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0441\u044f \u043a \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u0411\u0422 \u043c\u043e\u0434\u0443\u043b\u044e: \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u0434 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043c \u0432 onResume. onResume \u2013 \u044d\u0442\u043e \u043e\u0434\u043d\u043e \u0438\u0437 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u043d\u0430\u0448\u0435\u0433\u043e Activity, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e, Activity \u0432\u0438\u0434\u043d\u043e \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435, \u043e\u043d\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0444\u043e\u043a\u0443\u0441\u0435, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0441 \u043d\u0438\u043c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u0434 Activity:  <\/p>\n<pre><code class=\"java\">package com.robot.bluetoothrob2;  import java.io.IOException; import android.os.Bundle; import android.app.Activity; import android.util.Log; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; import android.bluetooth.*; import android.content.Intent;  public class MainActivity extends Activity { \tprivate static final int REQUEST_ENABLE_BT = 0; \tfinal String LOG_TAG = &quot;myLogs&quot;; \tpublic BluetoothAdapter btAdapter; \tprivate BluetoothSocket btSocket = null; \t\/\/ MAC-\u0430\u0434\u0440\u0435\u0441 Bluetooth \u043c\u043e\u0434\u0443\u043b\u044f \tprivate static String MacAdress = &quot;20:11:02:47:01:60&quot;; \tpublic TextView mytext; \t @Override protected void onCreate(Bundle savedInstanceState) { \t\tsuper.onCreate(savedInstanceState); \t\tsetContentView(R.layout.activity_main); \t\t\t\t \t\tbtAdapter = BluetoothAdapter.getDefaultAdapter(); \t\tmytext = (TextView) findViewById(R.id.txtrobot);          \t         if (btAdapter != null){         \tif (btAdapter.isEnabled()){         \t\tmytext.setText(&quot;Bluetooth \u0432\u043a\u043b\u044e\u0447\u0435\u043d. \u0412\u0441\u0435 \u043e\u0442\u043b\u0438\u0447\u043d\u043e.&quot;);\t\t\t         \t}else         \t{         \t\tIntent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);         \t\tstartActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);         \t}         \t         }else         {         \tMyError(&quot;Fatal Error&quot;, &quot;Bluetooth \u041e\u0422\u0421\u0423\u0422\u0421\u0422\u0412\u0423\u0415\u0422&quot;);         } \t} \t \t@Override \tpublic void onResume() { \t    super.onResume(); \t   \t    Log.d(LOG_TAG, &quot;***\u041f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c\u0441\u044f***&quot;); \t    \/\/ \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u043e \u0435\u0433\u043e MAC \u0430\u0434\u0440\u0435\u0441\u0443 \t    BluetoothDevice device = btAdapter.getRemoteDevice(MacAdress); \t    mytext.setText(&quot;***\u041f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 device = &quot; + device.getName() + &quot;***&quot;);\t \t  } \t \tprivate void MyError(String title, String message){ \t\t    Toast.makeText(getBaseContext(), title + &quot; - &quot; + message, Toast.LENGTH_LONG).show(); \t\t    finish(); \t} } <\/code><\/pre>\n<p>  \u0414\u043e\u0441\u0442\u0443\u043f \u043a \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u0411\u0422 \u043c\u043e\u0434\u0443\u043b\u044e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u043e \u0435\u0433\u043e \u041c\u0410\u0421 \u0430\u0434\u0440\u0435\u0441\u0443 btAdapter.getRemoteDevice(MacAdress). \u0423\u0437\u043d\u0430\u0442\u044c MAC-\u0430\u0434\u0440\u0435\u0441 \u0411\u0422 \u043c\u043e\u0434\u0443\u043b\u044f \u043c\u043e\u0436\u043d\u043e, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0434\u043b\u044f \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0430: Bluetooth Terminal. <br \/>  \u0427\u0442\u043e \u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u0441\u044f, \u0447\u0442\u043e \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0411\u0422 \u043c\u043e\u0434\u0443\u043b\u044e \u043f\u043e\u043b\u0443\u0447\u0435\u043d, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043c\u0435\u0442\u043e\u0434 getName(), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043c\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0411\u0422 \u043c\u043e\u0434\u0443\u043b\u044f, \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0430. <br \/>  \u0422\u0430\u043a\u0436\u0435 \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u0431\u044b\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e \u0445\u043e\u0434\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c, \u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f MyError, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0430\u0432\u0430\u0440\u0438\u0439\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<br \/>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0430 \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u043c \u043f\u043e\u043b\u0435 \u00abtxtrobot\u00bb \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u0441\u044f \u0438\u043c\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0411\u0422 \u043c\u043e\u0434\u0443\u043b\u044f.<\/p>\n<h5>Android \u0428\u0410\u0413 3<\/h5>\n<p>  \u0414\u043e\u0441\u0442\u0443\u043f \u043a \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u0411\u0422 \u043c\u043e\u0434\u0443\u043b\u044e \u043f\u043e\u043b\u0443\u0447\u0435\u043d, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043d\u0430\u0448 \u0448\u0430\u0433 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442 \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0430 \u043a \u043d\u0435\u043c\u0443. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 onResume(), \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u043e\u043a\u0435\u0442:  <\/p>\n<pre><code class=\"java\">btSocket = device.createRfcommSocketToServiceRecord(MY_UUID); <\/code><\/pre>\n<p>  \u0433\u0434\u0435 UUID (Universally Unique Identifier) \u2014 \u044d\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0432 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 UUID:   <\/p>\n<pre><code class=\"java\">private static final UUID MY_UUID = UUID.fromString(&quot;00001101-0000-1000-8000-00805F9B34FB&quot;); <\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0442\u043e\u0440\u043c\u043e\u0437\u0438\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043e\u0442\u043c\u0435\u043d\u0438\u043c \u043f\u043e\u0438\u0441\u043a \u0434\u0440\u0443\u0433\u0438\u0445 \u0411\u0422 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432:  <\/p>\n<pre><code class=\"java\">btAdapter.cancelDiscovery();\t <\/code><\/pre>\n<p>  \u041f\u043e\u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u043f\u043e\u0434\u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c\u0441\u044f:  <\/p>\n<pre><code class=\"java\">btSocket.connect(); <\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u043d\u0435 \u0443\u0434\u0430\u0447\u0435 \u0437\u0430\u043a\u0440\u043e\u0435\u043c \u0441\u043e\u043a\u0435\u0442:  <\/p>\n<pre><code class=\"java\">btSocket.close(); <\/code><\/pre>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u043c\u0435\u0442\u043e\u0434\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u043c\u0438, \u0438\u0445 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435, \u0447\u0442\u043e \u0431\u044b \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441:  <\/p>\n<pre><code class=\"java\">\t \/\/\u041a\u043b\u0430\u0441\u0441 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445   \t private class ConnectedThred extends Thread{ \t\t private final BluetoothSocket copyBtSocket; \t\t private final OutputStream OutStrem; \t\t  \t\t public ConnectedThred(BluetoothSocket socket){ \t\t\t copyBtSocket = socket; \t\t\t OutputStream tmpOut = null; \t\t\t try{ \t\t\t\t tmpOut = socket.getOutputStream(); \t\t\t } catch (IOException e){} \t\t\t  \t\t\t OutStrem = tmpOut; \t\t } \t\t  \t\t public void sendData(String message) { \t\t\t    byte[] msgBuffer = message.getBytes(); \t\t\t    Log.d(LOG_TAG, &quot;***\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435: &quot; + message + &quot;***&quot;  ); \t\t\t   \t\t\t    try { \t\t\t    \tOutStrem.write(msgBuffer); \t\t\t    } catch (IOException e) {} \t\t} \t\t  \t\t public void cancel(){ \t\t\t try { \t\t\t\t copyBtSocket.close(); \t\t\t }catch(IOException e){}\t\t\t  \t\t } \t\t  \t\t public Object status_OutStrem(){ \t\t\t if (OutStrem == null){return null;\t\t \t\t\t }else{return OutStrem;} \t\t } \t }   <\/code><\/pre>\n<p>  \u0412 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 public ConnectedThred(BluetoothSocket socket) \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u0447\u0435\u0440\u0435\u0437 \u0441\u043e\u043a\u0435\u0442:  <\/p>\n<pre><code class=\"java\">tmpOut = socket.getOutputStream(); <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e activity \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 sendData(String message) \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442\u0441\u044f \u043a \u0442\u0438\u043f\u0443 byte. \u041c\u0435\u0442\u043e\u0434 cancel() \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0441\u043e\u043a\u0435\u0442.<br \/>  \u041d\u0430\u043f\u0438\u0448\u0435\u043c, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043a\u043d\u043e\u043f\u043e\u043a b1 \u0438 b2, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 sendData(String message) \u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044c \u043e\u0431 \u044d\u0442\u043e\u043c \u0432 \u043b\u043e\u0433\u0435. \u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043d\u0438\u0436\u0435:  <\/p>\n<pre><code class=\"java\">package com.robot.bluetoothrob2;  import java.io.IOException; import java.io.OutputStream; import java.net.Socket; import java.util.UUID;  import com.robot.bluetoothrob2.R;  import android.os.Bundle; import android.app.Activity; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; import android.bluetooth.*; import android.content.Intent;  public class MainActivity extends Activity { \tprivate static final int REQUEST_ENABLE_BT = 1; \tfinal String LOG_TAG = &quot;myLogs&quot;; \tprivate BluetoothAdapter btAdapter = null; \tprivate BluetoothSocket btSocket = null; \tprivate static String MacAddress = &quot;20:11:02:47:01:60&quot;; \/\/ MAC-\u0430\u0434\u0440\u0435\u0441 \u0411\u0422 \u043c\u043e\u0434\u0443\u043b\u044f \tprivate static final UUID MY_UUID = UUID.fromString(&quot;00001101-0000-1000-8000-00805F9B34FB&quot;); \tprivate ConnectedThred MyThred = null; \tpublic TextView mytext; \tButton b1, b2; \t \t@Override \tprotected void onCreate(Bundle savedInstanceState) { \t\tsuper.onCreate(savedInstanceState); \t\tsetContentView(R.layout.activity_main); \t\t\t\t \t\tbtAdapter = BluetoothAdapter.getDefaultAdapter(); \t\tmytext = (TextView) findViewById(R.id.txtrobot);          \t         if (btAdapter != null){         \tif (btAdapter.isEnabled()){         \t\tmytext.setText(&quot;Bluetooth \u0432\u043a\u043b\u044e\u0447\u0435\u043d. \u0412\u0441\u0435 \u043e\u0442\u043b\u0438\u0447\u043d\u043e.&quot;);\t\t\t         \t}else         \t{         \t\tIntent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);         \t\tstartActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);         \t}         \t         }else         {         \tMyError(&quot;Fatal Error&quot;, &quot;Bluetooth \u041e\u0422\u0421\u0423\u0422\u0421\u0422\u0412\u0423\u0415\u0422&quot;);         }                  b1 = (Button) findViewById(R.id.b1);         b2 = (Button) findViewById(R.id.b2);                         b1.setOnClickListener(new OnClickListener() {           public void onClick(View v) {            MyThred.sendData(&quot;0&quot;);            mytext.setText(&quot;\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0435: 0&quot;);           }         });                b2.setOnClickListener(new OnClickListener() {           public void onClick(View v) {            MyThred.sendData(&quot;1&quot;);            mytext.setText(&quot;\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0435: 1&quot;);           }         });          \t} \t \t@Override \tpublic void onResume() { \t    super.onResume(); \t   \t    BluetoothDevice device = btAdapter.getRemoteDevice(MacAddress); \t    Log.d(LOG_TAG, &quot;***\u041f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 Device***&quot;+device.getName()); \t       \t    try { \t        btSocket = device.createRfcommSocketToServiceRecord(MY_UUID); \t        Log.d(LOG_TAG, &quot;...\u0421\u043e\u0437\u0434\u0430\u043b\u0438 \u0441\u043e\u043a\u0435\u0442...&quot;); \t      } catch (IOException e) { \t        MyError(&quot;Fatal Error&quot;, &quot;\u0412 onResume() \u041d\u0435 \u043c\u043e\u0433\u0443 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043e\u043a\u0435\u0442: &quot; + e.getMessage() + &quot;.&quot;); \t      }\t  \t     \t    btAdapter.cancelDiscovery();\t     \t    Log.d(LOG_TAG, &quot;***\u041e\u0442\u043c\u0435\u043d\u0438\u043b\u0438 \u043f\u043e\u0438\u0441\u043a \u0434\u0440\u0443\u0433\u0438\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432***&quot;); \t     \t    Log.d(LOG_TAG, &quot;***\u0421\u043e\u0435\u0434\u0438\u043d\u044f\u0435\u043c\u0441\u044f...***&quot;); \t    try { \t      btSocket.connect(); \t      Log.d(LOG_TAG, &quot;***\u0421\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e***&quot;); \t    } catch (IOException e) { \t      try { \t        btSocket.close(); \t      } catch (IOException e2) { \t        MyError(&quot;Fatal Error&quot;, &quot;\u0412 onResume() \u043d\u0435 \u043c\u043e\u0433\u0443 \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0441\u043e\u043a\u0435\u0442&quot; + e2.getMessage() + &quot;.&quot;); \t      } \t    } \t   \t   \t    MyThred = new ConnectedThred(btSocket);\t     \t  } \t \t  @Override \t  public void onPause() { \t    super.onPause(); \t   \t    Log.d(LOG_TAG, &quot;...In onPause()...&quot;); \t   \t    if (MyThred.status_OutStrem() != null) { \t        MyThred.cancel(); \t    } \t   \t    try     { \t      btSocket.close(); \t    } catch (IOException e2) { \t    \tMyError(&quot;Fatal Error&quot;, &quot;\u0412 onPause() \u041d\u0435 \u043c\u043e\u0433\u0443 \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0441\u043e\u043a\u0435\u0442&quot; + e2.getMessage() + &quot;.&quot;); \t    } \t  }\t \t \tprivate void MyError(String title, String message){ \t\t    Toast.makeText(getBaseContext(), title + &quot; - &quot; + message, Toast.LENGTH_LONG).show(); \t\t    finish(); \t}  \t   \t \/\/\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445   \t private class ConnectedThred extends Thread{ \t\t private final BluetoothSocket copyBtSocket; \t\t private final OutputStream OutStrem; \t\t  \t\t public ConnectedThred(BluetoothSocket socket){ \t\t\t copyBtSocket = socket; \t\t\t OutputStream tmpOut = null; \t\t\t try{ \t\t\t\t tmpOut = socket.getOutputStream(); \t\t\t } catch (IOException e){} \t\t\t  \t\t\t OutStrem = tmpOut; \t\t } \t\t  \t\t public void sendData(String message) { \t\t\t    byte[] msgBuffer = message.getBytes(); \t\t\t    Log.d(LOG_TAG, &quot;***\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435: &quot; + message + &quot;***&quot;  ); \t\t\t   \t\t\t    try { \t\t\t    \tOutStrem.write(msgBuffer); \t\t\t    } catch (IOException e) {} \t\t} \t\t  \t\t public void cancel(){ \t\t\t try { \t\t\t\t copyBtSocket.close(); \t\t\t }catch(IOException e){}\t\t\t  \t\t } \t\t  \t\t public Object status_OutStrem(){ \t\t\t if (OutStrem == null){return null;\t\t \t\t\t }else{return OutStrem;} \t\t } \t }  }  <\/code><\/pre>\n<p>  \u041d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u043d\u0430\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e \u0411\u0422 \u043e\u0442 \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0430 \u043a \u0430\u0440\u0434\u0443\u0438\u043d\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u2013 \u00ab0\u00bb \u0438 \u00ab1\u00bb, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0434\u043b\u044f \u0430\u0440\u0434\u0443\u0438\u043d\u043e \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438 \u00ab1\u00bb \u2014 \u0437\u0430\u0436\u0435\u0447\u044c \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434, \u0430 \u00ab0\u00bb \u2014 \u043f\u043e\u0442\u0443\u0448\u0438\u0442\u044c. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043e\u0431\u0449\u0435\u0439 \u0441\u0445\u0435\u043c\u044b \u0440\u043e\u0431\u043e\u0442\u0430, \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043e\u0442 \u00ab\u0433\u043e\u043b\u043e\u0432\u043d\u043e\u0433\u043e \u043c\u043e\u0437\u0433\u0430\u00bb \u043a \u00ab\u043c\u044b\u0448\u0446\u0430\u043c\u00bb. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0434\u0435\u043b\u043e \u0437\u0430 \u043c\u0430\u043b\u044b\u043c, \u043d\u0430\u0443\u0447\u0438\u0442\u044c \u0430\u043d\u0434\u0440\u043e\u0438\u0434 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442 \u00ab\u043e\u0440\u0433\u0430\u043d\u043e\u0432 \u0447\u0443\u0432\u0441\u0442\u0432\u00bb. <\/p>\n<h5>Android \u0428\u0410\u0413 4<\/h5>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0430\u043d\u0438\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e activity. \u041f\u0440\u0438\u043d\u044f\u0442\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442 \u0411\u0422 \u043c\u043e\u0434\u0443\u043b\u044f \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e activity \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u043c \u043f\u043e\u043b\u0435 \u2013 MyText. \u041d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u044c \u2014 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 view-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430. \u0410 \u043d\u043e\u0432\u044b\u0435 \u043f\u043e\u0442\u043e\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c, \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u044d\u043a\u0440\u0430\u043d\u0430. \u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u043c Handler.<br \/>  Handler \u2014 \u044d\u0442\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043e\u0447\u0435\u0440\u0435\u0434\u044c\u044e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439. \u041e\u043d \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d \u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443 \u043f\u043e\u0442\u043e\u043a\u0443 (thread) \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0435\u0433\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u044c\u044e. Handler \u0443\u043c\u0435\u0435\u0442 \u043f\u043e\u043c\u0435\u0449\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u044c. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u043d \u0441\u0442\u0430\u0432\u0438\u0442 \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0435\u0431\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u0418 \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0432\u0440\u0435\u043c\u044f, \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0434\u043e\u0441\u0442\u0430\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0438\u0437 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u0433\u043e \u0430\u0434\u0440\u0435\u0441\u0430\u0442\u0443 (\u0442.\u0435. \u0432 Handler) \u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443.<br \/>  \u041e\u0431\u044a\u044f\u0432\u0438\u043c Handler:  <\/p>\n<pre><code class=\"java\">Handler h; <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0432\u043e\u0439 Handler:   <\/p>\n<pre><code class=\"java\">  h = new Handler() {             public void handleMessage(android.os.Message msg) {               switch (msg.what) {               case ArduinoData: \t        \t  byte[] readBuf = (byte[]) msg.obj; \t              String strIncom = new String(readBuf, 0, msg.arg1);                                          \t              mytext.setText(&quot;\u0414\u0430\u043d\u043d\u044b\u0435 \u043e\u0442 Arduino: &quot; + strIncom);            \t              break;               }             };           }; <\/code><\/pre>\n<p>  \u0432 \u043d\u0435\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043c\u0435\u0442\u043e\u0434 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 handleMessage. \u041c\u044b \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u0438\u0437 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442 what, obj \u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0442\u0438\u043f\u0430 int. \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0435\u0433\u043e \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e activity: mytext.setText(\u00ab\u0414\u0430\u043d\u043d\u044b\u0435 \u043e\u0442 Arduino: \u00bb + strIncom);<br \/>  \u0412 \u043f\u043e\u0442\u043e\u043a\u0435 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430, \u0438 \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043c \u0442\u0430\u043c \u0446\u0438\u043a\u043b \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u0447\u0442\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445:   <\/p>\n<pre><code class=\"java\">public void run() \t\t { \t\t\t byte[] buffer = new byte[1024]; \t\t\t int bytes; \t\t\t  \t\t\t while(true){ \t\t\t\t try{ \t\t\t\t\t bytes = InStrem.read(buffer); \t\t\t\t\t h.obtainMessage(ArduinoData, bytes, -1, buffer).sendToTarget(); \t\t\t\t }catch(IOException e){break;}  \t\t\t\t  \t\t\t } \t\t\t   }  <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043d\u0438\u0436\u0435:  <\/p>\n<pre><code class=\"java\">package com.robot.bluetoothrob2;  import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.Socket; import java.util.UUID;  import com.robot.bluetoothrob2.R;  import android.os.Bundle; import android.os.Handler; import android.app.Activity; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; import android.bluetooth.*; import android.content.Intent;  public class MainActivity extends Activity { \tprivate static final int REQUEST_ENABLE_BT = 1; \tfinal int ArduinoData = 1;         \tfinal String LOG_TAG = &quot;myLogs&quot;; \tprivate BluetoothAdapter btAdapter = null; \tprivate BluetoothSocket btSocket = null; \tprivate static String MacAddress = &quot;20:11:02:47:01:60&quot;; \/\/ MAC-\u0430\u0434\u0440\u0435\u0441 \u0411\u0422 \u043c\u043e\u0434\u0443\u043b\u044f \tprivate static final UUID MY_UUID = UUID.fromString(&quot;00001101-0000-1000-8000-00805F9B34FB&quot;); \tprivate ConnectedThred MyThred = null; \tpublic TextView mytext; \tButton b1, b2; \tHandler h; \t \t@Override \tprotected void onCreate(Bundle savedInstanceState) { \t\tsuper.onCreate(savedInstanceState); \t\tsetContentView(R.layout.activity_main); \t\t\t\t \t\tbtAdapter = BluetoothAdapter.getDefaultAdapter(); \t\tmytext = (TextView) findViewById(R.id.txtrobot);          \t         if (btAdapter != null){         \tif (btAdapter.isEnabled()){         \t\tmytext.setText(&quot;Bluetooth \u0432\u043a\u043b\u044e\u0447\u0435\u043d. \u0412\u0441\u0435 \u043e\u0442\u043b\u0438\u0447\u043d\u043e.&quot;);\t\t\t         \t}else         \t{         \t\tIntent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);         \t\tstartActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);         \t}         \t         }else         {         \tMyError(&quot;Fatal Error&quot;, &quot;Bluetooth \u041e\u0422\u0421\u0423\u0422\u0421\u0422\u0412\u0423\u0415\u0422&quot;);         }                  b1 = (Button) findViewById(R.id.b1);         b2 = (Button) findViewById(R.id.b2);                         b1.setOnClickListener(new OnClickListener() {           public void onClick(View v) {            MyThred.sendData(&quot;0&quot;);            \/\/mytext.setText(&quot;\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0435: 0&quot;);           }         });                b2.setOnClickListener(new OnClickListener() {           public void onClick(View v) {            MyThred.sendData(&quot;1&quot;);           \/\/ mytext.setText(&quot;\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0435: 1&quot;);           }         });                  h = new Handler() {             public void handleMessage(android.os.Message msg) {               switch (msg.what) {               case ArduinoData: \t        \t  byte[] readBuf = (byte[]) msg.obj; \t              String strIncom = new String(readBuf, 0, msg.arg1);                                          \t              mytext.setText(&quot;\u0414\u0430\u043d\u043d\u044b\u0435 \u043e\u0442 Arduino: &quot; + strIncom);            \t              break;               }             };           };          \t} \t \t@Override \tpublic void onResume() { \t    super.onResume(); \t   \t    BluetoothDevice device = btAdapter.getRemoteDevice(MacAddress); \t    Log.d(LOG_TAG, &quot;***\u041f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 Device***&quot;+device.getName()); \t       \t    try { \t        btSocket = device.createRfcommSocketToServiceRecord(MY_UUID); \t        Log.d(LOG_TAG, &quot;...\u0421\u043e\u0437\u0434\u0430\u043b\u0438 \u0441\u043e\u043a\u0435\u0442...&quot;); \t      } catch (IOException e) { \t        MyError(&quot;Fatal Error&quot;, &quot;\u0412 onResume() \u041d\u0435 \u043c\u043e\u0433\u0443 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043e\u043a\u0435\u0442: &quot; + e.getMessage() + &quot;.&quot;); \t      }\t  \t     \t    btAdapter.cancelDiscovery();\t     \t    Log.d(LOG_TAG, &quot;***\u041e\u0442\u043c\u0435\u043d\u0438\u043b\u0438 \u043f\u043e\u0438\u0441\u043a \u0434\u0440\u0443\u0433\u0438\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432***&quot;); \t     \t    Log.d(LOG_TAG, &quot;***\u0421\u043e\u0435\u0434\u0438\u043d\u044f\u0435\u043c\u0441\u044f...***&quot;); \t    try { \t      btSocket.connect(); \t      Log.d(LOG_TAG, &quot;***\u0421\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e***&quot;); \t    } catch (IOException e) { \t      try { \t        btSocket.close(); \t      } catch (IOException e2) { \t        MyError(&quot;Fatal Error&quot;, &quot;\u0412 onResume() \u043d\u0435 \u043c\u043e\u0433\u0443 \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0441\u043e\u043a\u0435\u0442&quot; + e2.getMessage() + &quot;.&quot;); \t      } \t    } \t   \t   \t    MyThred = new ConnectedThred(btSocket);\t     \t    MyThred.start(); \t  } \t \t  @Override \t  public void onPause() { \t    super.onPause(); \t   \t    Log.d(LOG_TAG, &quot;...In onPause()...&quot;); \t   \t    if (MyThred.status_OutStrem() != null) { \t        MyThred.cancel(); \t    } \t   \t    try     { \t      btSocket.close(); \t    } catch (IOException e2) { \t    \tMyError(&quot;Fatal Error&quot;, &quot;\u0412 onPause() \u041d\u0435 \u043c\u043e\u0433\u0443 \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0441\u043e\u043a\u0435\u0442&quot; + e2.getMessage() + &quot;.&quot;); \t    } \t  }\t \t \tprivate void MyError(String title, String message){ \t\t    Toast.makeText(getBaseContext(), title + &quot; - &quot; + message, Toast.LENGTH_LONG).show(); \t\t    finish(); \t}  \t   \t \/\/\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445   \t private class ConnectedThred extends Thread{ \t\t private final BluetoothSocket copyBtSocket; \t\t private final OutputStream OutStrem; \t\t private final InputStream InStrem; \t\t  \t\t public ConnectedThred(BluetoothSocket socket){ \t\t\t copyBtSocket = socket; \t\t\t OutputStream tmpOut = null; \t\t\t InputStream tmpIn = null; \t\t\t try{ \t\t\t\t tmpOut = socket.getOutputStream(); \t\t\t\t tmpIn = socket.getInputStream(); \t\t\t } catch (IOException e){} \t\t\t  \t\t\t OutStrem = tmpOut; \t\t\t InStrem = tmpIn; \t\t } \t\t  \t\t public void run() \t\t { \t\t\t byte[] buffer = new byte[1024]; \t\t\t int bytes; \t\t\t  \t\t\t while(true){ \t\t\t\t try{ \t\t\t\t\t bytes = InStrem.read(buffer); \t\t\t\t\t h.obtainMessage(ArduinoData, bytes, -1, buffer).sendToTarget(); \t\t\t\t }catch(IOException e){break;}  \t\t\t\t  \t\t\t }  \t\t\t  \t\t } \t\t  \t\t public void sendData(String message) { \t\t\t    byte[] msgBuffer = message.getBytes(); \t\t\t    Log.d(LOG_TAG, &quot;***\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435: &quot; + message + &quot;***&quot;  ); \t\t\t   \t\t\t    try { \t\t\t    \tOutStrem.write(msgBuffer); \t\t\t    } catch (IOException e) {} \t\t} \t\t  \t\t public void cancel(){ \t\t\t try { \t\t\t\t copyBtSocket.close(); \t\t\t }catch(IOException e){}\t\t\t  \t\t } \t\t  \t\t public Object status_OutStrem(){ \t\t\t if (OutStrem == null){return null;\t\t \t\t\t }else{return OutStrem;} \t\t } \t }  } <\/code><\/pre>\n<p>  \u0412 \u0448\u0430\u0433\u0435 4, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442, \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e \u0411\u0422 \u043e\u0442 \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0430 \u043a \u0430\u0440\u0434\u0443\u0438\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0442\u0430\u043a \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043e\u0442 \u0430\u0440\u0434\u0443\u0438\u043d\u043e \u0434\u0430\u043d\u043d\u044b\u0435. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u0430 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b\u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443.<br \/>  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e \u0434\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c, \u043d\u0430 \u0435\u0433\u043e \u0431\u0430\u0437\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0441\u043c\u043e\u0433\u0443\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0442 \u0443\u043b\u044c\u0442\u0440\u0430\u0437\u0432\u0443\u043a\u043e\u0432\u043e\u0433\u043e \u0441\u0435\u043d\u0441\u043e\u0440\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043c\u043e\u0442\u043e\u0440\u0447\u0438\u043a\u0430\u043c, \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u0440\u043e\u0431\u043e\u0442\u0430.<br \/>  \u041a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0437\u0430\u043a\u0430\u0437 \u043d\u043e\u0432\u044b\u0445 \u0434\u0435\u0442\u0430\u043b\u0435\u0439 \u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u0441\u043f\u0438\u0441\u043e\u043a \u0438 \u0446\u0435\u043d\u044b:  <\/p>\n<table>\n<tr>\n<td>\u041d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u043d\u0438\u0435<\/td>\n<td> \u0421\u0441\u044b\u043b\u043a\u0430<\/td>\n<td> \u0426\u0435\u043d\u0430 y.e<\/td>\n<td> \u0426\u0435\u043d\u0430 \u0440\u0443\u0431<\/td>\n<td> \u041a\u043e\u043b-\u0432\u043e<\/td>\n<td> \u0421\u0443\u043c\u043c\u0430<\/td>\n<\/tr>\n<tr>\n<td>\u041c\u0430\u043a\u0435\u0442<\/td>\n<td> <a href=\"http:\/\/dx.com\/p\/solderless-breadboard-with-400-tie-point-white-121534\">dx.com\/p\/solderless-breadboard-with-400-tie-point-white-121534<\/a><\/td>\n<td>3,1<\/td>\n<td> 102,3<\/td>\n<td> 2<\/td>\n<td> 204,6<\/td>\n<\/tr>\n<tr>\n<td>\u0423\u043b\u044c\u0442\u0440\u0430\u0437\u0432\u0443\u043a\u043e\u0432\u043e\u0439 \u0441\u0435\u043d\u0441\u043e\u0440<\/td>\n<td> <a href=\"http:\/\/dx.com\/p\/ultrasonic-sensor-distance-measuring-module-138563\">dx.com\/p\/ultrasonic-sensor-distance-measuring-module-138563<\/a><\/td>\n<td>3,9<\/td>\n<td> 128,7<\/td>\n<td> 3<\/td>\n<td> 386,1<\/td>\n<\/tr>\n<tr>\n<td>\u0414\u0440\u0430\u0439\u0432\u0435\u0440 \u0434\u043b\u044f \u043c\u043e\u0442\u043e\u0440\u0430 2 \u0448\u0442. <\/td>\n<td> <a href=\"http:\/\/dx.com\/ru\/p\/hg7881-two-channel-motor-driver-board-blue-green-black-2-5-12v-215795\">dx.com\/ru\/p\/hg7881-two-channel-motor-driver-board-blue-green-black-2-5-12v-215795<\/a><\/td>\n<td>2,8<\/td>\n<td> 92,4<\/td>\n<td> 2<\/td>\n<td> 184,8<\/td>\n<\/tr>\n<tr>\n<td>\u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 <\/td>\n<td><a href=\"http:\/\/dx.com\/ru\/p\/zl-4-smart-car-chassis-kit-for-arduino-black-yellow-152992\">dx.com\/ru\/p\/zl-4-smart-car-chassis-kit-for-arduino-black-yellow-152992<\/a><\/td>\n<td>28,2<\/td>\n<td> 930,6<\/td>\n<td> 1<\/td>\n<td> 930,6<\/td>\n<\/tr>\n<tr>\n<td>\u041f\u0440\u043e\u0432\u043e\u0434\u043a\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f<\/td>\n<td> <a href=\"http:\/\/dx.com\/p\/breadboard-jumper-wire-cord-kit-for-arduino-diy-140-piece-pack-138220\">dx.com\/p\/breadboard-jumper-wire-cord-kit-for-arduino-diy-140-piece-pack-138220<\/a><\/td>\n<td>6,9<\/td>\n<td> 227,7 <\/td>\n<td>1<\/td>\n<td> 227,7<\/td>\n<\/tr>\n<tr>\n<td>\u041f\u0438\u0442\u0430\u043d\u0438\u0435 <\/td>\n<td><a href=\"http:\/\/dx.com\/ru\/p\/dc-power-converter-module-for-electronic-diy-219232\">dx.com\/ru\/p\/dc-power-converter-module-for-electronic-diy-219232<\/a><\/td>\n<td>2,3<\/td>\n<td> 75,9<\/td>\n<td> 1<\/td>\n<td> 75,9<\/td>\n<\/tr>\n<\/table>\n<p>   \u0418\u0422\u041e\u0413: 1933,8 \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/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\/208466\/\"> http:\/\/habrahabr.ru\/post\/208466\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0440\u043e\u0431\u043e\u0442\u0430, \u0434\u0430\u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u043e\u0433\u043e \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u043e\u043c, \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0438 \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430. \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0430\u044f \u0440\u043e\u0431\u043e\u0442\u043e\u0442\u0435\u0445\u043d\u0438\u043a\u0430 \u043f\u0435\u0440\u0435\u0436\u0438\u0432\u0430\u0435\u0442 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0431\u0443\u043c, \u0435\u0439 \u043d\u0430\u0447\u0430\u043b\u0438 \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u0436\u0435 \u0442\u0435 \u043b\u044e\u0434\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u0438\u043a\u0438 \u043e\u0447\u0435\u043d\u044c \u0434\u0430\u043b\u0435\u043a\u0438 (\u043a \u043d\u0438\u043c \u043e\u0442\u043d\u043e\u0448\u0443\u0441\u044c \u0438 \u044f). \u041f\u0440\u043e\u0448\u043b\u043e \u0442\u043e \u0432\u0440\u0435\u043c\u044f, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u0438\u0434\u0435\u0442\u044c \u043d\u043e\u0447\u0430\u043c\u0438 \u0441 \u043f\u0430\u044f\u043b\u044c\u043d\u0438\u043a\u043e\u043c, \u0438\u043b\u0438 \u0442\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u043b\u0430\u0442\u044b. \u0412\u0441\u0435 \u0441\u0442\u0430\u043b\u043e \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435, \u043d\u0443\u0436\u043d\u043e \u043b\u0438\u0448\u044c \u043a\u0443\u043f\u0438\u0442\u044c Arduino, \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0442 \u043f\u0440\u043e\u0432\u043e\u0434\u043a\u043e\u0432, \u0441\u0435\u043d\u0441\u043e\u0440\u044b, \u0434\u0430\u0442\u0447\u0438\u043a\u0438, \u043c\u043e\u0442\u043e\u0440\u0447\u0438\u043a\u0438 \u0438 \u0432\u043f\u0435\u0440\u0435\u0434 \u043a \u0441\u0431\u043e\u0440\u043a\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u043e\u0431\u043e\u0442\u0430. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0444\u043e\u043a\u0443\u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u2014 \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u0435\u0439 \u0441\u043c\u0435\u0441\u0442\u0438\u043b\u0441\u044f \u0441 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u0438\u043a\u0438 \u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e.<br \/>  \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0435\u0440\u0438\u044f \u0441\u0442\u0430\u0442\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0441\u0442\u0430\u0440\u0442\u0430 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u043e\u0431\u043e\u0442\u0430, \u043e\u0442 \u043f\u043e\u043a\u0443\u043f\u043a\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u0435\u0442\u0430\u043b\u0435\u0439 \u0434\u043e \u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432 \u043d\u0430\u0448 \u043c\u0438\u0440.   <\/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-208466","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/208466","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=208466"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/208466\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=208466"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=208466"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=208466"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}