{"id":42817,"date":"2018-06-06T22:52:50","date_gmt":"2018-06-06T16:52:50","guid":{"rendered":"http:\/\/rcl-radio.ru\/?p=42817"},"modified":"2022-01-15T12:36:55","modified_gmt":"2022-01-15T06:36:55","slug":"%d0%bf%d0%be%d1%81%d0%bb%d0%b5%d0%b4%d0%be%d0%b2%d0%b0%d1%82%d0%b5%d0%bb%d1%8c%d0%bd%d1%8b%d0%b9-%d0%bf%d0%be%d1%80%d1%82-arduino","status":"publish","type":"post","link":"http:\/\/rcl-radio.ru\/?p=42817","title":{"rendered":"\u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0440\u0442 (Arduino)"},"content":{"rendered":"<p>\u041d\u0430\u0431\u043e\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 Serial \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u0441\u0432\u044f\u0437\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 Arduino \u0441 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u043c \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u043c\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043e\u0431\u043c\u0435\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u0412\u0441\u0435 \u043f\u043b\u0430\u0442\u044b Arduino \u0438\u043c\u0435\u044e\u0442 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u0438\u043d \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0440\u0442 (UART, \u0438\u043d\u043e\u0433\u0434\u0430 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 USART). \u0414\u043b\u044f \u043e\u0431\u043c\u0435\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 Serial \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u0435 \u043f\u043e\u0440\u0442\u044b \u0432\u0432\u043e\u0434\/\u0432\u044b\u0432\u043e\u0434\u0430 0 (RX) \u0438 1 (TX), \u0430 \u0442\u0430\u043a\u0436\u0435 USB \u043f\u043e\u0440\u0442.<\/p>\n<p><strong>\u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Serial:<\/strong><\/p>\n<ul>\n<li><strong>Serial<\/strong> &#8212; \u043e\u0431\u044a\u0435\u043a\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Serial \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043f\u043e\u0440\u0442\u043e\u043c (COM \u043f\u043e\u0440\u0442\u043e\u043c)<\/li>\n<li><strong>Serial.begin(&lt;\u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c&gt;);<\/strong> &#8212; \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u043f\u043e\u0440\u0442<\/li>\n<li><strong>Serial.begin(9600);<\/strong> \/\/ \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u043f\u043e\u0440\u0442 \u043d\u0430 9600 \u0411\u041e\u0414<br \/>\n\u0412\u041d\u0418\u041c\u0410\u041d\u0418\u0415! \u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0432 begin(), \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u043d\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0430 \u043f\u043e\u0440\u0442\u0430 (\u0432<br \/>\n\u0441\u0430\u043c\u043e\u043c \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0435 \u043f\u0440\u0430\u0432\u044b\u0439 \u043d\u0438\u0436\u043d\u0438\u0439 \u0443\u0433\u043e\u043b).<\/li>\n<li><strong>Serial.print();<\/strong> &#8212; \u0432\u044b\u0432\u043e\u0434 \u0432 \u043f\u043e\u0440\u0442. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438 \u0446\u0438\u0444\u0440\u044b \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u0442\u0435\u043a\u0441\u0442 \u2013 \u0432 \u043a\u0430\u0432\u044b\u0447\u043a\u0430\u0445 &#187; &#171;<\/li>\n<li><strong>Serial.println();<\/strong> &#8212; \u0432\u044b\u0432\u043e\u0434 \u0441 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u043c \u0441\u0442\u0440\u043e\u043a\u0438<\/li>\n<li><strong>Serial.println(val, n)<\/strong>; &#8212; \u0432\u044b\u0432\u043e\u0434 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 val (\u0442\u0438\u043f\u0430 float) \u0441 n \u0447\u0438\u0441\u043b\u043e\u043c \u0437\u043d\u0430\u043a\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u044f\u0442\u043e\u0439<\/li>\n<li><strong>Serial.println(val, &lt;\u0431\u0430\u0437\u0438\u0441&gt;);<\/strong> &#8212; \u0432\u044b\u0432\u043e\u0434 \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u0431\u0430\u0437\u0438\u0441\u043e\u043c:<\/li>\n<\/ul>\n<p>DEC &#8212; \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u044b\u0439<br \/>\nHEX &#8212; 16-\u0440\u0438\u0447\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430<br \/>\nOCT &#8212; 8-\u0440\u0438\u0447\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430<br \/>\nBIN &#8212; \u0434\u0432\u043e\u0438\u0447\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430<\/p>\n<div id=\"marketWidget\"><\/div>\n<p>\u0414\u0430\u043d\u043d\u044b\u0435 \u0441 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442 \u0432 \u0431\u0443\u0444\u0435\u0440 \u0441 \u043e\u0431\u044a\u0451\u043c\u043e\u043c 64 \u0431\u0430\u0439\u0442\u0430, \u0438 \u0436\u0434\u0443\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n<ul>\n<li><strong>Serial.available();<\/strong> &#8212; \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0431\u0443\u0444\u0435\u0440 \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/li>\n<li><strong>Serial.read();<\/strong> &#8212; \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435! \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e ASCII<\/li>\n<li><strong>Serial.read() &#8212; &#8216;0&#8217;;<\/strong> &#8212; \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435. \u041f\u043e \u043e\u0434\u043d\u043e\u0439 \u0446\u0438\u0444\u0440\u0435.<\/li>\n<li><strong>Serial.parseInt();<\/strong> &#8212; \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435. \u0427\u0438\u0441\u043b\u043e \u0446\u0435\u043b\u0438\u043a\u043e\u043c.<\/li>\n<li><strong>Serial.flush();<\/strong> &#8212; \u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0431\u0443\u0444\u0435\u0440 \u043f\u043e\u0440\u0442\u0430<\/li>\n<\/ul>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<pre style=\"background: #0c1021; color: #f8f8f8;\"><span style=\"color: #8da6ce;\">void<\/span> setup()\r\n{\r\nSerial.begin(<span style=\"color: #d8fa3c;\">9600<\/span>);\r\n}\r\n<span style=\"color: #8da6ce;\">void<\/span> loop()\r\n{\r\ndelay(<span style=\"color: #d8fa3c;\">500<\/span>);\r\nSerial.println(<span style=\"color: #61ce3c;\">\"test\"<\/span>);\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u041d\u0430\u0431\u043e\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 Serial \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u0441\u0432\u044f\u0437\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 Arduino \u0441 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u043c \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u043c\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043e\u0431\u043c\u0435\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u0412\u0441\u0435 \u043f\u043b\u0430\u0442\u044b Arduino \u0438\u043c\u0435\u044e\u0442 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u0438\u043d \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0440\u0442 (UART, \u0438\u043d\u043e\u0433\u0434\u0430 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 USART). \u0414\u043b\u044f \u043e\u0431\u043c\u0435\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 Serial \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u0435 \u043f\u043e\u0440\u0442\u044b \u0432\u0432\u043e\u0434\/\u0432\u044b\u0432\u043e\u0434\u0430 0 (RX) \u0438 1 (TX), \u0430 \u0442\u0430\u043a\u0436\u0435 USB \u043f\u043e\u0440\u0442. \u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Serial: Serial &#8212; \u043e\u0431\u044a\u0435\u043a\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":42813,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[239],"tags":[],"class_list":["post-42817","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino"],"views":4902,"_links":{"self":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/42817","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=42817"}],"version-history":[{"count":3,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/42817\/revisions"}],"predecessor-version":[{"id":111581,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/42817\/revisions\/111581"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/media\/42813"}],"wp:attachment":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=42817"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=42817"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=42817"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}