{"id":346155,"date":"2023-03-02T15:01:26","date_gmt":"2023-03-02T15:01:26","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=346155"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=346155","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 7. \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<\/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\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><a href=\"https:\/\/habr.com\/ru\/post\/718518\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/yo\/ny\/cq\/yonycqhypilhipvabswqucrekgi.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/yo\/ny\/cq\/yonycqhypilhipvabswqucrekgi.jpeg\" data-blurred=\"true\"\/><\/a><\/p>\n<p>  <i><b>\u041e\u0442 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430.<\/b> \u0410\u0432\u0442\u043e\u0440 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e, \u043d\u043e \u043d\u0435\u0443\u043a\u043b\u043e\u043d\u043d\u043e \u0432\u0435\u0434\u0451\u0442 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f \u043a \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u043d\u0430 Arduino \u0438 \u0432\u0441\u0435\u043c\u0443 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u0442\u0435\u043a\u0430\u044e\u0449\u0435\u043c\u0443: \u043f\u043e\u043d\u044f\u0432 \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043c\u043e\u0436\u043d\u043e \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 IoT \u043f\u0440\u043e\u0435\u043a\u0442\u044b, \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0448\u0435\u0439 \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u0435\u0439.<\/p>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u0443\u0440\u043e\u043a\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \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 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 AJAX. \u0421\u043a\u0435\u0442\u0447 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0443\u0440\u043e\u043a\u0430 \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043b\u044e\u0431\u043e\u0433\u043e (\u0432 \u0440\u0430\u0437\u0443\u043c\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445, \u043a\u043e\u043d\u0435\u0447\u043d\u043e) \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043d\u043e\u043f\u043e\u043a \u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u0445 \u0432\u0445\u043e\u0434\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u043e\u0434 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 Arduino.<\/i><br \/>  <a name=\"habracut\"><\/a><br \/>  \u041d\u0430 \u044d\u0442\u043e\u043c \u0443\u0440\u043e\u043a\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0434\u0432\u0443\u0445 \u043a\u043d\u043e\u043f\u043e\u043a \u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 Arduino.<\/p>\n<p>  JavaScript \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438\u0445 AJAX \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0443 \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.<\/p>\n<p>  \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0432\u0438\u0434\u0435\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b: \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e AJAX \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u043a\u043d\u043e\u043f\u043a\u0438 \u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u0430, \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432\u0441\u0435\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0438 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0432\u0438\u0434\u0438\u043c\u044b\u0445 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u043e\u0432.<\/p>\n<div class=\"oembed\">\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/63f5d8759f1c6be050bc6ecd\" data-style=\"\" id=\"63f5d8759f1c6be050bc6ecd\" width=\"\"><\/div>\n<\/div>\n<p>  <\/p>\n<h2><font color=\"#1c22be\">\u276f<\/font> <font color=\"#454cee\"> \u041f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u044d\u043b\u0435\u043a\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0445\u0435\u043c\u0430<\/font><\/h2>\n<p>  \u041d\u0430 \u043d\u0438\u0436\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0439 \u0441\u0445\u0435\u043c\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a\u043d\u043e\u043f\u043e\u043a (\u043d\u0430 \u043f\u0438\u043d\u044b D7 \u0438 D8) \u043a \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0443 Arduino \u0441 \u043f\u043b\u0430\u0442\u043e\u0439 Ethernet Shield. \u041f\u043e\u0442\u0435\u043d\u0446\u0438\u043e\u043c\u0435\u0442\u0440 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u043a \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u043c\u0443 \u0432\u0445\u043e\u0434\u0443 A2 \u0438 \u043f\u0440\u0438 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u044d\u0442\u043e\u043c \u0432\u0445\u043e\u0434\u0435 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0435\u0433\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435.<\/p>\n<p>  \u041f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u043a\u043d\u043e\u043f\u043e\u043a \u0438 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u043e\u043c\u0435\u0442\u0440\u0430 \u043a \u043f\u043b\u0430\u0442\u0435 Arduino:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/cz\/-_\/ce\/cz-_cef2gedywn19x6yx_i2coto.png\" data-src=\"https:\/\/habrastorage.org\/webt\/cz\/-_\/ce\/cz-_cef2gedywn19x6yx_i2coto.png\"\/><\/div>\n<h2><font color=\"#1c22be\">\u276f<\/font> <font color=\"#454cee\"> \u0421\u043a\u0435\u0442\u0447<\/font><\/h2>\n<p>  \u0421\u043a\u0435\u0442\u0447 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0443\u0440\u043e\u043a\u0430 \u2014 \u044d\u0442\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0441\u043a\u0435\u0442\u0447\u0430 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 <a href=\"https:\/\/habr.com\/en\/company\/timeweb\/blog\/717772\/\">\u0441\u0442\u0430\u0442\u044c\u0438<\/a>.<\/p>\n<pre><code class=\"java\">\/*--------------------------------------------------------------   \u0421\u043a\u0435\u0442\u0447:      eth_websrv_AJAX_IN    \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435:  Arduino \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0449\u0438\u0439 \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.      \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, 2 \u043a\u043d\u043e\u043f\u043a\u0438, \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u043e\u043c\u0435\u0442\u0440.                    \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      \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    \u0414\u0430\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f:         20 \u0444\u0435\u0432\u0440\u0430\u043b\u044f 2013     \u0410\u0432\u0442\u043e\u0440:       W.A. Smith, http:\/\/startingelectronics.org --------------------------------------------------------------*\/  #include &lt;SPI.h> #include &lt;Ethernet.h>  byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; IPAddress ip(10, 0, 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);  String HTTP_req; \/\/ \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f HTTP \u0437\u0430\u043f\u0440\u043e\u0441\u0430  void setup() {     Ethernet.begin(mac, ip);     server.begin();     Serial.begin(115200);     pinMode(7, INPUT); \/\/ \u043a\u043d\u043e\u043f\u043a\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u043a \u043f\u043b\u0430\u0442\u0435 Arduino \u043d\u0430 \u043f\u0438\u043d D7     pinMode(8, INPUT); \/\/ \u043a\u043d\u043e\u043f\u043a\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u043a \u043f\u043b\u0430\u0442\u0435 Arduino \u043d\u0430 \u043f\u0438\u043d D8 }  void loop() {     EthernetClient client = server.available();  \/\/ try to get client      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                 HTTP_req += c; \/\/ \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0441\u0438\u043c\u0432\u043e\u043b HTTP \u0437\u0430\u043f\u0440\u043e\u0441\u0430                 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(\"HTTP\/1.1 200 OK\");                     client.println(\"Content-Type: text\/html\");                     client.println(\"Connection: keep-alive\");                     client.println();                      if (HTTP_req.indexOf(\"ajax_switch\") > -1) {                         \/\/ AJAX \u0437\u0430\u043f\u0440\u043e\u0441                         GetAjaxData(client);                     } else {                         \/\/ \u041f\u043e\u0441\u044b\u043b\u043a\u0430 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0439 JavaScript \u043a\u043e\u0434 \u0438 AJAX \u0432\u044b\u0437\u043e\u0432\u044b                         client.println(\"&lt;!DOCTYPE html>\");                         client.println(\"&lt;html>\");                         client.println(\"&lt;head>\");                         client.println(\"&lt;title>Arduino Web Page&lt;\/title>\");                         client.println(\"&lt;script>\");                         client.println(\"function GetSwitchAnalogData() {\");                         client.println(                             \"nocache = \\\"&amp;nocache=\\\" + Math.random() * 1000000;\");                         client.println(\"var request = new XMLHttpRequest();\");                         client.println(\"request.onreadystatechange = function() {\");                         client.println(\"if (this.readyState == 4) {\");                         client.println(\"if (this.status == 200) {\");                         client.println(\"if (this.responseText != null) {\");                         client.println(\"document.getElementById(\\\"sw_an_data\\\")\\ .innerHTML = this.responseText;\");                         client.println(\"}}}}\");                         client.println(                         \"request.open(\\\"GET\\\", \\\"ajax_switch\\\" + nocache, true);\");                         client.println(\"request.send(null);\");                         client.println(\"setTimeout('GetSwitchAnalogData()', 1000);\");                         client.println(\"}\");                         client.println(\"&lt;\/script>\");                         client.println(\"&lt;\/head>\");                          \/\/ \u0422\u0435\u043b\u043e \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b                         client.println(\"&lt;body onload=\\\"GetSwitchAnalogData()\\\">\");                         client.println(\"&lt;h1>Arduino AJAX Input&lt;\/h1>\");                         client.println(\"&lt;div id=\\\"sw_an_data\\\">\");                         client.println(\"&lt;\/div>\");                         client.println(\"&lt;\/body>\");                         client.println(\"&lt;\/html>\");                     }                     \/\/ \u0412\u044b\u0432\u043e\u0434\u0438\u043c \u043f\u0440\u0438\u043d\u044f\u0442\u044b\u0439 HTTP \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 Serial                     Serial.print(HTTP_req);                     HTTP_req = \"\";                     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) }  \/\/ \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u0445 \u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u043e\u0432 \u0438 \u043f\u043e\u0441\u044b\u043b\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u043d\u0438\u0445 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440  void GetAjaxData(EthernetClient cl) {     int analog_val;          if (digitalRead(7)) {         cl.println(\"&lt;p>Switch 7 state: ON&lt;\/p>\");     } else {         cl.println(\"&lt;p>Switch 7 state: OFF&lt;\/p>\");     }      if (digitalRead(8)) {         cl.println(\"&lt;p>Switch 8 state: ON&lt;\/p>\");     } else {         cl.println(\"&lt;p>Switch 8 state: OFF&lt;\/p>\");     }      \/\/ \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u043c \u0432\u0445\u043e\u0434\u043e\u043c A2      analog_val = analogRead(2);     cl.print(\"&lt;p>Analog A2: \");     cl.print(analog_val);     cl.println(\"&lt;\/p>\"); } <\/code><\/pre>\n<p>  <\/p>\n<h3><font color=\"#454cee\">\u041a\u043e\u0434 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b<\/font><\/h3>\n<p>  \u0412\u044b\u0448\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 Arduino \u0441\u043a\u0435\u0442\u0447 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 HTML \u043a\u043e\u0434:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/xj\/7q\/qr\/xj7qqrr6q0bbrquiqilkzs9oipi.png\" data-src=\"https:\/\/habrastorage.org\/webt\/xj\/7q\/qr\/xj7qqrr6q0bbrquiqilkzs9oipi.png\"\/><\/p>\n<h3><font color=\"#454cee\">\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0441\u043a\u0435\u0442\u0447\u0435 (\u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u0435\u0440\u0441\u0438\u0438 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0443\u0440\u043e\u043a\u0430)<\/font><\/h3>\n<p>  \u041f\u0438\u043d\u044b D7 \u0438 D8 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 Arduino \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u0432\u0445\u043e\u0434\u044b \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 setup() \u0441\u043a\u0435\u0442\u0447\u0430.<\/p>\n<pre><code class=\"java\">    pinMode(7, INPUT); \/\/ \u043a\u043d\u043e\u043f\u043a\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u043a \u043f\u043b\u0430\u0442\u0435 Arduino \u043d\u0430 \u043f\u0438\u043d D7     pinMode(8, INPUT); \/\/ \u043a\u043d\u043e\u043f\u043a\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u043a \u043f\u043b\u0430\u0442\u0435 Arduino \u043d\u0430 \u043f\u0438\u043d D8 <\/code><\/pre>\n<p>  \u0411\u044b\u043b\u0430 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0430 JavaScript \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 AJAX \u0432\u044b\u0437\u043e\u0432\u044b.<\/p>\n<pre><code class=\"java\">GetSwitchAnalogData() <\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0431\u044b\u043b\u0430 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0430 Arduino \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0430\u044f \u043d\u0430 AJAX \u0437\u0430\u043f\u0440\u043e\u0441\u044b.<\/p>\n<pre><code class=\"java\">void GetAjaxData(EthernetClient cl) { <\/code><\/pre>\n<p>  \u041f\u043e\u0434 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u043c H1 \u0432 HTML \u043a\u043e\u0434\u0435 \u0441\u043e\u0437\u0434\u0430\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442 div \u0441 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c \u00absw_an_data\u00bb. \u0421\u0430\u043c \u0442\u0435\u0433 div \u043d\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435, \u043d\u043e \u0441\u043b\u0443\u0436\u0438\u0442 \u043c\u0435\u0441\u0442\u043e\u043c \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f JavaScript \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 (\u0434\u0430\u043d\u043d\u044b\u0445 \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, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0445 \u043e\u0442 Arduino).<\/p>\n<h4><font color=\"#454cee\">\u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438\u0437 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430<\/font><\/h4>\n<p>  JavaScript \u0444\u0443\u043d\u043a\u0446\u0438\u044f GetSwitchAnalogData() \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u0438 \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 GET \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0430 Arduino \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440.<\/p>\n<h4><font color=\"#454cee\">\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 AJAX \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0430 Arduino<\/font><\/h4>\n<p>  \u041a\u043e\u0433\u0434\u0430 Arduino \u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b AJAX \u0437\u0430\u043f\u0440\u043e\u0441, \u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e GetAjaxData(). \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u043a\u043d\u043e\u043f\u043e\u043a \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 (ON \u0438\u043b\u0438 OFF) \u0432 \u043e\u0442\u0432\u0435\u0442 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0443. \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0442\u0430\u043a\u0436\u0435 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u0430 A2 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0443.<\/p>\n<h4><font color=\"#454cee\">\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0432\u0435\u0431-\u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435<\/font><\/h4>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u0432\u0435\u0431-\u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435, \u0437\u0430\u043f\u0440\u043e\u0448\u0435\u043d\u043d\u044b\u0435 \u0438\u043c \u0443 Arduino \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043e\u043d \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0445 \u0432 \u0442\u0435\u0433 div \u0441 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c sw_an_data.<\/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 7-\u0439 \u0447\u0430\u0441\u0442\u0438<\/font><\/h2>\n<p>  <i>\u041d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u043c \u0442\u0440\u0443\u0434\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u044d\u0442\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043e\u043d\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u00ab\u0445\u0438\u0442\u0440\u043e\u00bb \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u2014 Javascript \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u0430\u043c\u0430 \u0441\u0435\u0431\u044f \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0438\u043c\u0435\u0435\u0442 \u0443\u0447\u0430\u0441\u0442\u043a\u0438 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0441\u0442\u0443\u043f\u0430\u044e\u0442 \u0432 \u0440\u0430\u0431\u043e\u0442\u0443 \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u043e, \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 Arduino. \u0410 \u0441\u0435\u0440\u0432\u0435\u0440 Arduino, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0441\u044b\u043b\u0430\u0435\u0442 HTML \u043a\u043e\u0434 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u0430 \u00ab\u0441\u0438\u043d\u0442\u0435\u0437\u0438\u0440\u0443\u0435\u0442\u00bb \u0435\u0449\u0451 \u0438 \u0441\u0430\u043c Javascript \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 \u0441\u0430\u043c\u0438\u043c Arduino \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c.<\/p>\n<p>  \u0423 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445, \u0441 \u043d\u0435\u043f\u0440\u0438\u0432\u044b\u0447\u043a\u0438, \u0443\u043c \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0439\u0442\u0438 \u0437\u0430 \u0440\u0430\u0437\u0443\u043c \u043e\u0442 \u0442\u0430\u043a\u0438\u0445 \u00ab\u043d\u0430\u0432\u043e\u0440\u043e\u0442\u043e\u0432\u00bb. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u0431\u044b \u043f\u043e\u0441\u043e\u0432\u0435\u0442\u043e\u0432\u0430\u043b \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0443\u0447\u0430\u0441\u0442\u043e\u043a Arduino \u043a\u043e\u0434\u0430:<\/p>\n<pre><code class=\"java\">                    if (HTTP_req.indexOf(\"ajax_switch\") > -1) {                         \/\/ AJAX \u0437\u0430\u043f\u0440\u043e\u0441                         GetAjaxData(client);                     } else {                         \/\/ \u041f\u043e\u0441\u044b\u043b\u043a\u0430 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0439 JavaScript \u043a\u043e\u0434 \u0438 AJAX \u0432\u044b\u0437\u043e\u0432\u044b                         client.println(\"&lt;!DOCTYPE html>\"); <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u043e\u0434\u0438\u043d \u0438\u0437 \u00ab\u0443\u0437\u043b\u043e\u0432\u044b\u0445\u00bb \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u0441\u0435\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c: \u0437\u0434\u0435\u0441\u044c \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043a\u0430\u043a\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u043d\u0435\u043c\u0443 \u043f\u0440\u0438\u0448\u0451\u043b \u2014 \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u00ab\u043f\u0440\u043e\u0441\u0442\u043e\u0439\u00bb GET \u0437\u0430\u043f\u0440\u043e\u0441, \u0442\u043e \u043e\u043d \u0432\u044b\u0434\u0430\u0451\u0442 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0443 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443, \u0430 \u0435\u0441\u043b\u0438 \u044d\u0442\u043e\u0442 AJAX \u0437\u0430\u043f\u0440\u043e\u0441, \u0442\u043e \u043e\u043d \u0432\u044b\u0434\u0430\u0451\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u0442\u0432\u0435\u0442 \u0441 AJAX \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \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.<\/p>\n<p>  \u0412\u0430\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c: \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u044b\u0434\u0430\u0451\u0442 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u00ab\u0441\u0435\u0430\u043d\u0441\u0430\u00bb, \u0430 \u0437\u0430\u0442\u0435\u043c (\u043c\u0430\u0441\u0441\u043e\u0432\u043e \u0438 \u0431\u0435\u0441\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u043e) \u043f\u043e\u0441\u044b\u043b\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e AJAX \u043e\u0442\u0432\u0435\u0442\u044b \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438\u043c \u0436\u0435 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e Javascript \u043a\u043e\u0434\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u044d\u0442\u043e\u0439 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b.<\/p>\n<p>  \u041b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u044f\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u043e\u0436\u043d\u043e, \u0435\u0441\u043b\u0438 \u043d\u0430\u0436\u0430\u0442\u044c (\u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 Firefox) \u043a\u043b\u0430\u0432\u0438\u0448\u0443 F12 \u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0432\u043a\u043b\u0430\u0434\u043a\u0443 \u00abNetwork\u00bb.<\/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>.<\/i><\/p>\n<p>  <a href=\"https:\/\/timeweb.cloud\/\/vds-vps?utm_source=habr&amp;utm_medium=banner&amp;utm_campaign=vds-promo-6-rub\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/p-\/u9\/l2\/p-u9l27ynelxi92bcmdxhu76ma8.png\" data-src=\"https:\/\/habrastorage.org\/webt\/p-\/u9\/l2\/p-u9l27ynelxi92bcmdxhu76ma8.png\"\/><\/a><\/div>\n<\/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\/company\/timeweb\/blog\/718518\/\"> https:\/\/habr.com\/ru\/company\/timeweb\/blog\/718518\/<\/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\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><a href=\"https:\/\/habr.com\/ru\/post\/718518\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/yo\/ny\/cq\/yonycqhypilhipvabswqucrekgi.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/yo\/ny\/cq\/yonycqhypilhipvabswqucrekgi.jpeg\" data-blurred=\"true\"\/><\/a><\/p>\n<p>  <i><b>\u041e\u0442 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430.<\/b> \u0410\u0432\u0442\u043e\u0440 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e, \u043d\u043e \u043d\u0435\u0443\u043a\u043b\u043e\u043d\u043d\u043e \u0432\u0435\u0434\u0451\u0442 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f \u043a \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u043d\u0430 Arduino \u0438 \u0432\u0441\u0435\u043c\u0443 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u0442\u0435\u043a\u0430\u044e\u0449\u0435\u043c\u0443: \u043f\u043e\u043d\u044f\u0432 \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043c\u043e\u0436\u043d\u043e \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 IoT \u043f\u0440\u043e\u0435\u043a\u0442\u044b, \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0448\u0435\u0439 \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u0435\u0439.<\/p>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u0443\u0440\u043e\u043a\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \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 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 AJAX. \u0421\u043a\u0435\u0442\u0447 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0443\u0440\u043e\u043a\u0430 \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043b\u044e\u0431\u043e\u0433\u043e (\u0432 \u0440\u0430\u0437\u0443\u043c\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445, \u043a\u043e\u043d\u0435\u0447\u043d\u043e) \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043d\u043e\u043f\u043e\u043a \u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u0445 \u0432\u0445\u043e\u0434\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u043e\u0434 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 Arduino.<\/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-346155","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/346155","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=346155"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/346155\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=346155"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=346155"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=346155"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}