{"id":347839,"date":"2023-05-24T15:00:55","date_gmt":"2023-05-24T15:00:55","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=347839"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=347839","title":{"rendered":"<span>Starting Electronics: \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c \u043d\u0430 Arduino. \u0427\u0430\u0441\u0442\u044c 12. \u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 DI \u0438 AI \u0432\u0445\u043e\u0434\u043e\u0432 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Ajax \u0438 XML<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\"><a href=\"https:\/\/habr.com\/ru\/post\/736488\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/pz\/of\/o6\/pzofo6fnzyaz4if1az2cyqu_b1q.jpeg\"><\/a><\/p>\n<p>  <i><b>\u041e\u0442 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430.<\/b> \u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 Ajax \u0438 \u0425ML \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0442 Arduino \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0443 \u0438 \u0434\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435.<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 XML \u0444\u0430\u0439\u043b\u043e\u0432 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Javascript \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u0438 \u0443\u0434\u043e\u0431\u043d\u0435\u0435, \u0447\u0435\u043c \u043f\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435.<\/i><br \/>  <a name=\"habracut\"><\/a><br \/>  Arduino \u0441\u0435\u0440\u0432\u0435\u0440 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 (\u0445\u0440\u0430\u043d\u044f\u0449\u0443\u044e\u0441\u044f \u043d\u0430 SD-\u043a\u0430\u0440\u0442\u0435), \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u043a\u043d\u043e\u043f\u043e\u043a \u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u0430.<\/p>\n<p>  \u0421\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043a\u043d\u043e\u043f\u043e\u043a \u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Ajax. XML \u0444\u0430\u0439\u043b, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u043a\u043d\u043e\u043f\u043e\u043a \u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0437 Arduino \u0432 \u0432\u0435\u0431-\u0431\u0440\u0430\u0443\u0437\u0435\u0440.<\/p>\n<p>  \u042d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0442\u043e\u0442 \u0436\u0435 \u0432\u044b\u0432\u043e\u0434 \u043d\u0430 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 (\u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043d\u044b\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u043c), \u0447\u0442\u043e \u0438 \u0432 <a href=\"https:\/\/habr.com\/ru\/post\/718518\/\">7-\u0439 \u0447\u0430\u0441\u0442\u0438<\/a> \u044d\u0442\u043e\u0433\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u2014 \u00ab\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 DI \u0438 AI \u0432\u0445\u043e\u0434\u043e\u0432 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 AJAX\u00bb, \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438:  <\/p>\n<ul>\n<li>\u0421\u0442\u0430\u0442\u0443\u0441\u044b \u043a\u043d\u043e\u043f\u043e\u043a \u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 XML \u0444\u0430\u0439\u043b\u0435, \u0430 \u043d\u0435 \u0432 \u0432\u0438\u0434\u0435 \u0431\u043b\u043e\u043a\u0430 HTML.<\/li>\n<li>\u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u0437 XML-\u0444\u0430\u0439\u043b\u0430 \u0432\u043c\u0435\u0441\u0442\u043e responseText \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f JavaScript responseXML.<\/li>\n<li>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 XML \u0444\u0430\u0439\u043b\u0430 (\u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442 Arduino) \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432 HTML \u0430\u0431\u0437\u0430\u0446\u044b \u043d\u0430 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0432\u043c\u0435\u0441\u0442\u043e \u0437\u0430\u043c\u0435\u043d\u044b \u0432\u0441\u0435\u0433\u043e \u0430\u0431\u0437\u0430\u0446\u0430 \u0446\u0435\u043b\u0438\u043a\u043e\u043c.<\/li>\n<li>\u0412\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043d\u0430 microSD \u043a\u0430\u0440\u0442\u0435 \u043f\u0430\u043c\u044f\u0442\u0438, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0451\u043d\u043d\u043e\u0439 \u043a \u043f\u043b\u0430\u0442\u0435 Ethernet Shield.<\/li>\n<\/ul>\n<p>  <b>\u0417\u0430\u0447\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Ajax \u0441 XML?<\/b><\/p>\n<p>  \u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Ajax \u0441 XML \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u044b (\u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u044b) \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e JavaScript, \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 JavaScript \u043a\u043e\u0434 \u0434\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u0437 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430.<\/p>\n<h2><font color=\"#1c22be\">\u276f<\/font> <font color=\"#454cee\"> \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 XML \u0444\u0430\u0439\u043b\u0430<\/font><\/h2>\n<p>  XML \u0444\u0430\u0439\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0442\u0435\u0433\u0438, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0432 HTML \u0438\u043b\u0438 XHTML. \u0424\u0430\u0439\u043b \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0442\u0435\u0433, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u0442 \u0435\u0433\u043e \u043a\u0430\u043a XML \u0444\u0430\u0439\u043b. \u0414\u0430\u043b\u0435\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0442\u0435\u0433, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0433\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439.<\/p>\n<p>  \u041d\u0438\u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 XML \u0444\u0430\u0439\u043b\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435:<\/p>\n<pre><code class=\"plaintext\">&lt;?xml version = &quot;1.0&quot; ?&gt; &lt;inputs&gt;     &lt;button1&gt;&lt;\/button1&gt;     &lt;button2&gt;&lt;\/button2&gt;     &lt;analog1&gt;&lt;\/analog1&gt; &lt;\/inputs&gt; <\/code><\/pre>\n<p>  \u0422\u0435\u0433 inputs \u0438 \u0432\u0441\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f (\u0438\u043c\u0435\u043d\u0430) \u0434\u0440\u0443\u0433\u0438\u0445 \u0442\u0435\u0433\u043e\u0432, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435\u0441\u044f \u0432 \u043d\u0435\u043c, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c. \u042d\u0442\u043e\u0442 XML \u043a\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0440\u0443\u0433\u0438\u043c:<\/p>\n<pre><code class=\"plaintext\">&lt;?xml version = &quot;1.0&quot; ?&gt; &lt;inputs&gt;     &lt;button&gt;&lt;\/button&gt;     &lt;button&gt;&lt;\/button&gt;     &lt;analog&gt;&lt;\/analog&gt; &lt;\/inputs&gt; <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0442\u0435\u0433\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u0442\u0438\u043f\u044b \u00ab\u043a\u043d\u043e\u043f\u043a\u0430\u00bb \u0438 \u00ab\u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u00bb, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043a\u043d\u043e\u043f\u043a\u0438 \u0438\u043b\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u0430. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u0442\u0435\u0433\u043e\u0432 button \u0438\u043b\u0438 analog, \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043d\u043e\u043f\u043e\u043a \u0438\u043b\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u0445 \u0432\u0445\u043e\u0434\u043e\u0432.<\/p>\n<p>  \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c\u0438 \u0434\u0432\u0443\u043c\u044f \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u043c\u0435\u043d\u0430 (\u0442\u0435\u0433\u0438) \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0430 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0442\u0435\u0433\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u0430 \u0432\u0432\u043e\u0434\u0430.<\/p>\n<h3><font color=\"#454cee\">XML \u0444\u0430\u0439\u043b Arduino<\/font><\/h3>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 Arduino \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0444\u0430\u0439\u043b XML \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 \u043d\u0435\u0433\u043e \u043c\u0435\u0436\u0434\u0443 \u0442\u0435\u0433\u0430\u043c\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u043a\u043d\u043e\u043f\u043e\u043a \u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u0430. \u042d\u0442\u043e\u0442 XML \u0444\u0430\u0439\u043b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0443 \u0432 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0435\u0433\u043e Ajax \u0437\u0430\u043f\u0440\u043e\u0441.<\/p>\n<p>  \u041d\u0438\u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u043f\u0440\u0438\u043c\u0435\u0440 XML \u0444\u0430\u0439\u043b\u0430, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0441 Arduino \u0441\u0440\u0432\u0435\u0440\u0430.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/8n\/t8\/2w\/8nt82w8i5sesmxxahqluqqk8c-q.jpeg\"><\/p>\n<h2><font color=\"#1c22be\">\u276f<\/font> <font color=\"#454cee\"> \u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 Ajax \u0441 XML<\/font><\/h2>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0438\u0441\u044c \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c\u0438 \u0447\u0430\u0441\u0442\u044f\u043c\u0438 \u044d\u0442\u043e\u0433\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430, \u0442\u043e \u043c\u043d\u043e\u0433\u043e\u0435 \u0438\u0437 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043d\u0430 \u044d\u0442\u043e\u043c \u0443\u0440\u043e\u043a\u0435 \u043f\u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0432\u0430\u043c \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u043c.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f Arduino \u0432\u0445\u043e\u0434\u043e\u0432 \u043d\u0430 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435, \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<h3><font color=\"#454cee\">1. \u0417\u0430\u043f\u0440\u043e\u0441 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b<\/font><\/h3>\n<p>  \u041a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e, \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0443 Arduino \u043f\u043e IP-\u0430\u0434\u0440\u0435\u0441\u0443, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u0432 \u0441\u043a\u0435\u0442\u0447\u0435 Arduino.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/e4\/dt\/22\/e4dt22_i6bhvqawxzr5oplw4gj8.jpeg\"><br \/>  <i><font color=\"#999999\">\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0443 Arduino<\/font><\/i><\/p>\n<p>  \u042d\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 \u0432\u0435\u0431-\u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u043c HTTP \u0437\u0430\u043f\u0440\u043e\u0441\u0430:<\/p>\n<pre><code class=\"plaintext\">GET \/ HTTP\/1.1 Host: 10.0.0.20 User-Agent: Mozilla\/5.0 (X11; Ubuntu; Linux i686; rv:19.0) Gecko\/20100101 Firefox\/19.0 Accept: text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8 Accept-Language: en-ZA,en-GB;q=0.8,en-US;q=0.5,en;q=0.3 Accept-Encoding: gzip, deflate Connection: keep-alive <\/code><\/pre>\n<p>  <\/p>\n<h3><font color=\"#454cee\">2. \u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b<\/font><\/h3>\n<p>  \u0412\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 Arduino \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0432\u044b\u0448\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 HTTP \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u043c, \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0441\u0430\u043c\u0430 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430:<\/p>\n<pre><code class=\"plaintext\">HTTP\/1.1 200 OK Content-Type: text\/html Connection: keep-alive <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/wf\/y1\/vq\/wfy1vqw-ayf70q7q1asczsuwvbc.jpeg\"><\/p>\n<p>  Arduino \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0441 SD \u043a\u0430\u0440\u0442\u044b \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u0451 \u0432 \u0432\u0435\u0431-\u0431\u0440\u0430\u0443\u0437\u0435\u0440. \u041f\u043e\u0441\u043b\u0435 \u0435\u0451 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f, \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0432 \u0432\u0435\u0431-\u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 (\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0435\u0451 \u0443\u0432\u0438\u0434\u0438\u0442 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435).<\/p>\n<p>  \u042d\u0442\u0430 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 JavaScript \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b Ajax.<\/p>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0442\u0438\u043f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0432 HTTP \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u2014 HTML (text\/html).<\/p>\n<h3><font color=\"#454cee\">3. Ajax \u0437\u0430\u043f\u0440\u043e\u0441<\/font><\/h3>\n<p>  JavaScript \u043a\u043e\u0434, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439\u0441\u044f \u043d\u0430 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435, \u0438\u043d\u0438\u0446\u0438\u0438\u0440\u0443\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 Ajax \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 Arduino (\u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u0435\u043a\u0443\u043d\u0434\u0443).<\/p>\n<pre><code class=\"plaintext\">GET \/ajax_inputs&amp;nocache=299105.2747379479 HTTP\/1.1 Host: 10.0.0.20 User-Agent: Mozilla\/5.0 (X11; Ubuntu; Linux i686; rv:19.0) Gecko\/20100101 Firefox\/19.0 Accept: text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8 Accept-Language: en-ZA,en-GB;q=0.8,en-US;q=0.5,en;q=0.3 Accept-Encoding: gzip <\/code><\/pre>\n<p>  <\/p>\n<h3><font color=\"#454cee\">4. Arduino \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 Ajax<\/font><\/h3>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0438\u0432 \u0437\u0430\u043f\u0440\u043e\u0441 XML \u0444\u0430\u0439\u043b\u0430, Arduino \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c HTTP \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u043c, \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0441\u0430\u043c XML \u0444\u0430\u0439\u043b, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043d\u0443\u0436\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0432\u0445\u043e\u0434\u043e\u0432 Arduino.<\/p>\n<pre><code class=\"plaintext\">HTTP\/1.1 200 OK Content-Type: text\/xml Connection: keep-alive <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/8n\/t8\/2w\/8nt82w8i5sesmxxahqluqqk8c-q.jpeg\"><\/p>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0442\u0438\u043f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0432 HTTP \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 \u0442\u0435\u043f\u0435\u0440\u044c text\/xml.<\/p>\n<h3><font color=\"#454cee\">5. \u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/font><\/h3>\n<p>  \u0418 \u043d\u0430\u043a\u043e\u043d\u0435\u0446, JavaScript \u043d\u0430 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0442\u0440\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 XML \u0444\u0430\u0439\u043b\u0430 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u0438\u0445 \u043d\u0430 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435.<\/p>\n<h2><font color=\"#1c22be\">\u276f<\/font> <font color=\"#454cee\"> Arduino \u0441\u043a\u0435\u0442\u0447 \u0438 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430<\/font><\/h2>\n<p>  <\/p>\n<h3><font color=\"#454cee\">\u0412\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430<\/font><\/h3>\n<p>  Arduino \u0441\u0435\u0440\u0432\u0435\u0440 \u0445\u0440\u0430\u043d\u0438\u0442 \u043d\u0430 SD \u043a\u0430\u0440\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/wf\/y1\/vq\/wfy1vqw-ayf70q7q1asczsuwvbc.jpeg\"><\/p>\n<p>  \u041f\u043e \u0441\u0443\u0442\u0438, \u044d\u0442\u043e \u0442\u0430 \u0436\u0435 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043a\u0430\u043a \u0438 \u0432 7-\u0439 \u0447\u0430\u0441\u0442\u0438 \u044d\u0442\u043e\u0433\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430, \u043d\u043e \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438 (\u043f\u043e\u043c\u0438\u043c\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0442\u0435\u043a\u0441\u0442\u0430):<\/p>\n<h4><font color=\"#454cee\">\u0424\u0443\u043d\u043a\u0446\u0438\u044f<\/font><\/h4>\n<p>  JavaScript \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0430 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0431\u044b\u043b\u0430 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0430 \u0432 GetArduinoInputs().<\/p>\n<p>  \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 Ajax \u0437\u0430\u043f\u0440\u043e\u0441 \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u0435\u043a\u0443\u043d\u0434\u0443. \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 GET \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0435\u043a\u0441\u0442 (\u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440) \u00abajax_inputs\u00bb.<\/p>\n<p>  \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432 \u043e\u0442\u0432\u0435\u0442 \u0441 Arduino \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f XML \u0444\u0430\u0439\u043b, \u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 responseXML, \u0432\u043c\u0435\u0441\u0442\u043e responseText, \u043a\u0430\u043a \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438:<\/p>\n<pre><code class=\"java\">if (this.responseXML != null) { <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u044e\u0442\u0441\u044f \u0438\u0437 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e XML, \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0438\u0436\u0435:<\/p>\n<h4><font color=\"#454cee\">HTML<\/font><\/h4>\n<p>  HTML \u043a\u043e\u0434 \u0438\u0437\u043c\u0435\u043d\u0435\u043d \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0442\u0440\u0435\u0445 \u0430\u0431\u0437\u0430\u0446\u0435\u0432 \u0442\u0435\u043a\u0441\u0442\u0430, \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0441 Arduino. \u041a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u044d\u0442\u0438\u0445 \u0430\u0431\u0437\u0430\u0446\u0435\u0432 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u0435\u0433 span c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c.<\/p>\n<p>  JavaScript \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u0438\u0437 XML \u0444\u0430\u0439\u043b\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043a\u0430\u0436\u0434\u044b\u0439 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u0433 span. \u042d\u0442\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442 \u0442\u0435\u043a\u0441\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u00ab&#8230;\u00bb \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0430\u0431\u0437\u0430\u0446\u0435 \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0432\u0445\u043e\u0434\u043e\u0432 Arduino.<\/p>\n<p>  \u0414\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 (\u0437\u0434\u0435\u0441\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u043a\u043e\u0434 \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438 input1):<\/p>\n<pre><code class=\"java\">document.getElementById(&quot;input1&quot;).innerHTML = <\/code><\/pre>\n<p>  <\/p>\n<h4><font color=\"#454cee\">\u0418\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 XML \u0434\u0430\u043d\u043d\u044b\u0445<\/font><\/h4>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0435 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u044e\u0442\u0441\u044f \u0438\u0437 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e XML \u0444\u0430\u0439\u043b\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<pre><code class=\"java\">this.responseXML.getElementsByTagName('button1')[0].childNodes[0].nodeValue; <\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u043a\u043e\u0434\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f this.responseXML \u0432\u043c\u0435\u0441\u0442\u043e this.responseText, \u043a\u0430\u043a \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043a \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0442\u0435\u0433\u0443 \u0432 XML \u0444\u0430\u0439\u043b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 this.responseXML.getElementsByTagName(&#8216;button1&#8217;) \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 button1).<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0432\u0435\u0440\u043d\u0435\u0442\u0435\u0441\u044c \u043a \u043d\u0430\u0447\u0430\u043b\u0443 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b \u00ab\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 XML-\u0444\u0430\u0439\u043b\u0430\u00bb, \u0442\u043e \u0443\u0432\u0438\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0442\u0435\u0433\u0438 \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438 \u0438\u043c\u0435\u043d\u0430\u043c\u0438. \u0415\u0441\u043b\u0438 \u0431\u044b \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u044d\u0442\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0442\u0435\u0433\u043e\u0432 \u043a\u043d\u043e\u043f\u043e\u043a, \u0442\u043e \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"java\">this.responseXML.getElementsByTagName('button')[0].childNodes[0].nodeValue; this.responseXML.getElementsByTagName('button')[1].childNodes[0].nodeValue; <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043d\u043e\u043f\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0432\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0442\u044c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0433\u0438. \u0412 JavaScript \u043a \u044d\u0442\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0446\u0438\u043a\u043b\u0430. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043a\u043d\u043e\u043f\u043e\u043a \u0431\u0443\u0434\u0443\u0442 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u044b \u0432 \u0442\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043d\u0438 \u0431\u044b\u043b\u0438 \u0432\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0444\u0430\u0439\u043b.<\/p>\n<p>  \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u043e\u0431\u0449\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043d\u043e\u043f\u043e\u043a \u0432 \u0444\u0430\u0439\u043b\u0435 XML \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"java\">this.responseXML.getElementsByTagName('button').length <\/code><\/pre>\n<p>  <\/p>\n<h3><font color=\"#454cee\">\u0421\u043a\u0435\u0442\u0447 \u0410\u0440\u0434\u0443\u0438\u043d\u043e<\/font><\/h3>\n<p>  Arduino \u0441\u043a\u0435\u0442\u0447 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u043d\u0438\u0436\u0435.<\/p>\n<pre><code class=\"java\">\/*--------------------------------------------------------------   \u0421\u043a\u0435\u0442\u0447:      eth_websrv_SD_Ajax_XML    \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435:  Arduino \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 \u0441 SD \u043a\u0430\u0440\u0442\u043e\u0439, \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 (\u0440\u0430\u0437 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443) \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0449\u0438\u0439 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u043a\u043d\u043e\u043f\u043e\u043a \u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u0430 \u043d\u0430 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Ajax \u0438 XML.      \u041e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0435: \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 Arduino Uno, \u043f\u043b\u0430\u0442\u0430 Ethernet Shield, microSD \u043a\u0430\u0440\u0442\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 2 \u0413\u0411, \u0434\u0432\u0435 \u043a\u043d\u043e\u043f\u043a\u0438, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0451\u043d\u043d\u044b\u0435 \u043d\u0430 \u043f\u0438\u043d\u044b D7 \u0438 D8 Arduino, \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u043e\u043c\u0435\u0442\u0440, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0451\u043d\u043d\u044b\u0439 \u043d\u0430 \u043f\u0438\u043d A2.                    \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435: \u0441\u0440\u0435\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 Arduino IDE, microSD \u043a\u0430\u0440\u0442\u0430 \u0441 \u0444\u0430\u0439\u043b\u043e\u043c index.htm      \u0421\u0441\u044b\u043b\u043a\u0438:     - WebServer example by David A. Mellis and modified by Tom Igoe     - Ethernet library documentation: http:\/\/arduino.cc\/en\/Reference\/Ethernet     - Learning PHP, MySQL &amp; JavaScript by Robin Nixon, O'Reilly publishers     - SD Card library documentation: http:\/\/arduino.cc\/en\/Reference\/SD    \u0414\u0430\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f: 27 \u043c\u0430\u0440\u0442\u0430 2013   \u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f: 17 \u0438\u044e\u043d\u044f 2013     \u0410\u0432\u0442\u043e\u0440: W.A. Smith, http:\/\/startingelectronics.org --------------------------------------------------------------*\/  #include &lt;SPI.h&gt; #include &lt;Ethernet.h&gt; #include &lt;SD.h&gt;  byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; IPAddress ip(192, 168, 0, 20); \/\/ IP-\u0430\u0434\u0440\u0435\u0441 (\u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0439 \u0441\u0435\u0442\u0438) EthernetServer server(80); File webFile;  \/\/ \u0411\u0443\u0444\u0435\u0440 \u0434\u043b\u044f HTTP \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 #define REQ_BUF_SZ   50 char HTTP_req[REQ_BUF_SZ] = {0}; \/\/ \u0425\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043a\u0430\u043a null terminated string char req_index = 0;  \/\/ \u0438\u043d\u0434\u0435\u043a\u0441 \u0431\u0443\u0444\u0435\u0440\u0430  void setup() {     \/\/ \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 Ethernet     pinMode(10, OUTPUT);     digitalWrite(10, HIGH);          Serial.begin(115200);          Serial.println(&quot;Initializing SD card...&quot;);     if (!SD.begin(4)) {         Serial.println(&quot;ERROR - SD card initialization failed!&quot;);         return;     }     Serial.println(&quot;SUCCESS - SD card initialized.&quot;);      if (!SD.exists(&quot;index.htm&quot;)) {         Serial.println(&quot;ERROR - Can't find index.htm file!&quot;);         return;     }     Serial.println(&quot;SUCCESS - Found index.htm file.&quot;);      pinMode(7, INPUT);        \/\/ \u041a\u043d\u043e\u043f\u043a\u0430 \u043d\u0430 D7     pinMode(8, INPUT);        \/\/ \u041a\u043d\u043e\u043f\u043a\u0430 \u043d\u0430 D8          Ethernet.begin(mac, ip);     server.begin(); }  void loop() {     EthernetClient client = server.available();      if (client) {         boolean currentLineIsBlank = true;         while (client.connected()) {             if (client.available()) {                 char c = client.read(); \/\/ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0431\u0430\u0439\u0442 (\u0441\u0438\u043c\u0432\u043e\u043b) \u043e\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0430                 \/\/ \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 0 (null terminate string)                 if (req_index &lt; (REQ_BUF_SZ - 1)) {                     HTTP_req[req_index] = c; \/\/ \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0441\u0438\u043c\u0432\u043e\u043b HTTP \u0437\u0430\u043f\u0440\u043e\u0441\u0430                     req_index++;                 }                  if (c == '\\n' &amp;&amp; currentLineIsBlank) {                     \/\/ \u041f\u043e\u0441\u044b\u043b\u0430\u0435\u043c http \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a                     client.println(&quot;HTTP\/1.1 200 OK&quot;);                     \/\/ HTML \u0438\u043b\u0438 XML \u0437\u0430\u043f\u0440\u043e\u0441                     if (StrContains(HTTP_req, &quot;ajax_inputs&quot;)) {                         client.println(&quot;Content-Type: text\/xml&quot;);                         client.println(&quot;Connection: keep-alive&quot;);                         client.println();                         XML_response(client);                     } else {                         client.println(&quot;Content-Type: text\/html&quot;);                         client.println(&quot;Connection: keep-alive&quot;);                         client.println();                         webFile = SD.open(&quot;index.htm&quot;);                         if (webFile) {                             while(webFile.available()) {                                 client.write(webFile.read());                             }                             webFile.close();                         }                     }                     Serial.print(HTTP_req);                     \/\/ \u041e\u0431\u043d\u0443\u043b\u044f\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432 (\u0431\u0443\u0444\u0435\u0440)                     req_index = 0;                     StrClear(HTTP_req, REQ_BUF_SZ);                     break;                 }                 if (c == '\\n') {                     currentLineIsBlank = true;                 }                  else if (c != '\\r') {                     currentLineIsBlank = false;                 }             } \/\/ end if (client.available())         } \/\/ end while (client.connected())         delay(1);         client.stop();     } \/\/ end if (client) }  \/\/ \u041f\u043e\u0441\u044b\u043b\u0430\u0435\u043c XML \u0444\u0430\u0439\u043b void XML_response(EthernetClient cl) {     int analog_val;          cl.print(&quot;&lt;?xml version = \\&quot;1.0\\&quot; ?&gt;&quot;);     cl.print(&quot;&lt;inputs&gt;&quot;);     cl.print(&quot;&lt;button1&gt;&quot;);     if (digitalRead(7)) {         cl.print(&quot;ON&quot;);     } else {         cl.print(&quot;OFF&quot;);     }     cl.print(&quot;&lt;\/button1&gt;&quot;);     cl.print(&quot;&lt;button2&gt;&quot;);     if (digitalRead(8)) {         cl.print(&quot;ON&quot;);     } else {         cl.print(&quot;OFF&quot;);     }     cl.print(&quot;&lt;\/button2&gt;&quot;);     \/\/ read analog pin A2     analog_val = analogRead(2);     cl.print(&quot;&lt;analog1&gt;&quot;);     cl.print(analog_val);     cl.print(&quot;&lt;\/analog1&gt;&quot;);     cl.print(&quot;&lt;\/inputs&gt;&quot;); }  \/\/ \u041e\u0431\u043d\u0443\u043b\u0435\u043d\u0438\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 void StrClear(char *str, char length) {     for (int i = 0; i &lt; length; i++) {         str[i] = 0;     } }  \/\/ \u041f\u043e\u0438\u0441\u043a \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438 \/\/ 1, \u0435\u0441\u043b\u0438 \u043d\u0430\u0439\u0434\u0435\u043d\u0430 \/\/ 0, \u0435\u0441\u043b\u0438 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u0430 char StrContains(char *str, char *sfind) {     char found = 0;     char index = 0;     char len;      len = strlen(str);          if (strlen(sfind) &gt; len) {         return 0;     }     while (index &lt; len) {         if (str[index] == sfind[found]) {             found++;             if (strlen(sfind) == found) {                 return 1;             }         }         else {             found = 0;         }         index++;     }      return 0; } <\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u0441\u043a\u0435\u0442\u0447 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u0441\u043a\u0435\u0442\u0447\u0430 \u0438\u0437 <a href=\"https:\/\/habr.com\/ru\/post\/733744\/\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438<\/a> \u044d\u0442\u043e\u0433\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430.<\/p>\n<h4><font color=\"#454cee\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 XML \u0444\u0430\u0439\u043b\u0430<\/font><\/h4>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f XML_response() \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 XML \u0444\u0430\u0439\u043b\u0430 \u0432 \u0443\u0436\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u043d\u043e\u043c \u0440\u0430\u043d\u0435\u0435 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u0435.<\/p>\n<p>  \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043a\u043d\u043e\u043f\u043e\u043a \u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u0430 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432 XML \u0444\u0430\u0439\u043b \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432 \u0432\u0435\u0431-\u0431\u0440\u0430\u0443\u0437\u0435\u0440.<\/p>\n<h4><font color=\"#454cee\">HTTP \u043e\u0442\u0432\u0435\u0442<\/font><\/h4>\n<p>  \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 HTTP \u043e\u0442\u0432\u0435\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0434\u043b\u044f HTML \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0438 XML \u0444\u0430\u0439\u043b\u0430 (text\/html \u0438\u043b\u0438 text\/xml), \u0442\u043e \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0435\u0433\u043e \u043a\u043e\u0434 \u0431\u044b\u043b \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d \u0432 \u0441\u043a\u0435\u0442\u0447\u0435 \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c HTTP \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435.<\/p>\n<p>  \u041a\u0430\u043a \u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u044d\u0442\u043e\u0433\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430, \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 SD \u043a\u0430\u0440\u0442\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 \u0432\u0438\u0434\u0435 \u0444\u0430\u0439\u043b\u0430 index.htm \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0443, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043a \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0443 Arduino.<\/p>\n<h2><font color=\"#1c22be\">\u276f<\/font> <font color=\"#454cee\"> \u0417\u0430\u043f\u0443\u0441\u043a \u0441\u043a\u0435\u0442\u0447\u0430<\/font><\/h2>\n<p>  \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u043a Arduino \u043a\u043d\u043e\u043f\u043a\u0438 \u0438 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u043e\u043c\u0435\u0442\u0440, \u043a\u0430\u043a \u0431\u044b\u043b\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0430 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0445\u0435\u043c\u0435 \u0432 7-\u0439 \u0447\u0430\u0441\u0442\u0438 \u044d\u0442\u043e\u0433\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430.<\/p>\n<p>  \u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u0444\u0430\u0439\u043b index.htm (\u0441\u043c. \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 \u043d\u0438\u0436\u0435) \u043d\u0430 microSD \u043a\u0430\u0440\u0442\u0443 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0432\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0435\u0451 \u0432 \u0440\u0430\u0437\u044a\u0435\u043c \u043d\u0430 \u043f\u043b\u0430\u0442\u0435 Ethernet Shield.<\/p>\n<p>  \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0432\u044b\u0448\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u0441\u043a\u0435\u0442\u0447 \u0432 Arduino \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u0441\u044c \u043a Arduino \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u0435\u0431-\u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430.<\/p>\n<p>  \u0412\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u0432\u044b \u043d\u0435 \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0431\u043e\u0442\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0443\u0440\u043e\u043a\u0430 \u0438 \u0438\u0437 7-\u0439 \u0447\u0430\u0441\u0442\u0438 \u044d\u0442\u043e\u0433\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430, \u043d\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 (\u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439) \u0441\u043f\u043e\u0441\u043e\u0431 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 \u0441 Arduino.<\/p>\n<h3><font color=\"#454cee\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b<\/font><\/h3>\n<p>  \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0441\u044e\u0434\u0430 \u0438 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u0444\u0430\u0439\u043b \u0441 \u0438\u043c\u0435\u043d\u0435\u043c index.htm:<\/p>\n<pre><code class=\"plaintext\">&lt;!DOCTYPE html&gt; &lt;html&gt;     &lt;head&gt;         &lt;title&gt;Arduino SD Card Web Page using Ajax with XML&lt;\/title&gt;         &lt;script&gt;         function GetArduinoInputs() {             nocache = &quot;&amp;nocache=&quot; + Math.random() * 1000000;             var request = new XMLHttpRequest();             request.onreadystatechange = function() {                 if (this.readyState == 4) {                     if (this.status == 200) {                         if (this.responseXML != null) {                             \/\/ extract XML data from XML file (containing switch states and analog value)                             document.getElementById(&quot;input1&quot;).innerHTML =                                 this.responseXML.getElementsByTagName('button1')[0].childNodes[0].nodeValue;                             document.getElementById(&quot;input2&quot;).innerHTML =                                 this.responseXML.getElementsByTagName('button2')[0].childNodes[0].nodeValue;                             document.getElementById(&quot;input3&quot;).innerHTML =                                 this.responseXML.getElementsByTagName('analog1')[0].childNodes[0].nodeValue;                         }                     }                 }             }             request.open(&quot;GET&quot;, &quot;ajax_inputs&quot; + nocache, true);             request.send(null);             setTimeout('GetArduinoInputs()', 1000);         }     &lt;\/script&gt;     &lt;\/head&gt;     &lt;body onload=&quot;GetArduinoInputs()&quot;&gt;         &lt;h1&gt;Arduino Inputs from SD Card Web Page using Ajax with XML&lt;\/h1&gt;         &lt;p&gt;Button 1 (pin 7): &lt;span id=&quot;input1&quot;&gt;...&lt;\/span&gt;&lt;\/p&gt;         &lt;p&gt;Button 2 (pin 8): &lt;span id=&quot;input2&quot;&gt;...&lt;\/span&gt;&lt;\/p&gt;         &lt;p&gt;Analog (A2): &lt;span id=&quot;input3&quot;&gt;...&lt;\/span&gt;&lt;\/p&gt;     &lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<p>  <\/p>\n<h2><font color=\"#1c22be\">\u276f<\/font> <font color=\"#454cee\"> \u041e\u0442 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430 \u043e 12-\u0439 \u0447\u0430\u0441\u0442\u0438<\/font><\/h2>\n<p>  <i>\u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0430\u0432\u0442\u043e\u0440 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0435\u0442 \u0442\u0435\u0445\u043d\u0438\u043a\u0443 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f Arduino \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u0432\u0435\u0431-\u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Ajax \u0438 XML, \u043d\u043e \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044f\u0445 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0431\u0449\u0438\u0445 \u0432\u0435\u0449\u0435\u0439.<\/p>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0444\u0430\u0439\u043b \u0444\u043e\u0440\u043c\u0430\u0442\u0430 XML \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u043d\u0435\u043a\u0438\u043c \u00ab\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u043c\u00bb, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u0441\u0451\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0440\u0430\u0437\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u0438 \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0434\u043b\u044f (\u0443\u0434\u043e\u0431\u043d\u043e\u0433\u043e) \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443\u0436\u0435 \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Javascript.<\/p>\n<p>  \u041d\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0442\u0430\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0442\u0435\u043a\u0441\u0442, \u0444\u0430\u0439\u043b\u044b \u0444\u043e\u0440\u043c\u0430\u0442\u0430 JSON, \u0438\u043b\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0442\u0430\u043a\u043e\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Ajax \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043c\u0435\u043d\u0435\u043d\u043e \u043d\u0430 \u043e\u0431\u043c\u0435\u043d \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Websockets \u0438 \u0442.\u00a0\u043f.<\/p>\n<p>  <a href=\"https:\/\/habr.com\/en\/company\/timeweb\/blog\/709986\/\">\u0427\u0430\u0441\u0442\u044c 1<\/a>, <a href=\"https:\/\/habr.com\/en\/company\/timeweb\/blog\/711042\/\">\u0447\u0430\u0441\u0442\u044c 2<\/a>, <a href=\"https:\/\/habr.com\/en\/company\/timeweb\/blog\/712120\/\">\u0447\u0430\u0441\u0442\u044c 3<\/a>, <a href=\"https:\/\/habr.com\/en\/company\/timeweb\/blog\/714334\/\">\u0447\u0430\u0441\u0442\u044c 4<\/a>, <a href=\"https:\/\/habr.com\/en\/company\/timeweb\/blog\/716362\/\">\u0447\u0430\u0441\u0442\u044c 5<\/a>, <a href=\"https:\/\/habr.com\/en\/company\/timeweb\/blog\/717772\/\">\u0447\u0430\u0441\u0442\u044c 6<\/a>, <a href=\"https:\/\/habr.com\/en\/company\/timeweb\/blog\/718518\/\">\u0447\u0430\u0441\u0442\u044c 7<\/a>, <a href=\"https:\/\/habr.com\/en\/company\/timeweb\/blog\/721056\/\">\u0447\u0430\u0441\u0442\u044c 8<\/a>, <a href=\"https:\/\/habr.com\/en\/company\/timeweb\/blog\/723474\/\">\u0447\u0430\u0441\u0442\u044c 9<\/a>, <a href=\"https:\/\/habr.com\/en\/company\/timeweb\/blog\/730036\/\">\u0447\u0430\u0441\u0442\u044c 10<\/a>, <a href=\"https:\/\/habr.com\/en\/company\/timeweb\/blog\/733744\/\">\u0447\u0430\u0441\u0442\u044c 11<\/a>.<\/i><\/p>\n<p>  <a href=\"https:\/\/timeweb.cloud\/vds-vps?utm_source=habr&amp;utm_medium=banner&amp;utm_campaign\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/mx\/ua\/nb\/mxuanbovcusqgmqdgugvpnql8vq.jpeg\"><\/a><\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/companies\/timeweb\/articles\/736488\/\"> https:\/\/habr.com\/ru\/companies\/timeweb\/articles\/736488\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\"><a href=\"https:\/\/habr.com\/ru\/post\/736488\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/pz\/of\/o6\/pzofo6fnzyaz4if1az2cyqu_b1q.jpeg\"><\/a><\/p>\n<p>  <i><b>\u041e\u0442 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430.<\/b> \u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 Ajax \u0438 \u0425ML \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0442 Arduino \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0443 \u0438 \u0434\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435.<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 XML \u0444\u0430\u0439\u043b\u043e\u0432 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Javascript \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u0438 \u0443\u0434\u043e\u0431\u043d\u0435\u0435, \u0447\u0435\u043c \u043f\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435.<\/i>  <\/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-347839","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/347839","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=347839"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/347839\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=347839"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=347839"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=347839"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}