{"id":80037,"date":"2020-06-07T16:33:47","date_gmt":"2020-06-07T10:33:47","guid":{"rendered":"http:\/\/rcl-radio.ru\/?p=80037"},"modified":"2022-01-08T18:12:27","modified_gmt":"2022-01-08T12:12:27","slug":"rs485-arduino","status":"publish","type":"post","link":"http:\/\/rcl-radio.ru\/?p=80037","title":{"rendered":"RS485 Arduino"},"content":{"rendered":"<p>RS485 \u2014 \u044d\u0442\u043e \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 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u043b\u0438\u043d\u0430 \u043b\u0438\u043d\u0438\u0438 \u043f\u0440\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0438 \u043f\u043e RS485 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 1200 \u043c\u0435\u0442\u0440\u043e\u0432. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u0430\u0431\u0435\u043b\u044f \u0434\u043b\u044f RS485 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u0438\u0442\u0430\u044f \u043f\u0430\u0440\u0430. \u042d\u0442\u043e \u0434\u0432\u0430 \u043f\u0440\u043e\u0432\u043e\u0434\u0430, \u0441\u043f\u043b\u0435\u0442\u0435\u043d\u043d\u044b\u0435 \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c. \u0427\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0434\u0438\u0441\u0442\u0430\u043d\u0446\u0438\u0438 \u0431\u043e\u043b\u0435\u0435 500 \u043c\u0435\u0442\u0440\u043e\u0432, \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0432\u0438\u0442\u0430\u044f \u043f\u0430\u0440\u0430.<\/p>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0434\u0432\u0435 \u043f\u043b\u0430\u0442\u044b \u0410\u0440\u0434\u0443\u0438\u043d\u043e \u043f\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443 RS485 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u044c RS485 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043c\u0438\u043a\u0440\u043e\u0441\u0445\u0435\u043c\u0430 MAX485.<\/p>\n<p><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/06\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-06-07-161715.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-80038\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/06\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-06-07-161715.png\" alt=\"\" width=\"359\" height=\"264\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/06\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-06-07-161715.png 635w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/06\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-06-07-161715-200x147.png 200w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/06\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-06-07-161715-500x368.png 500w\" sizes=\"auto, (max-width: 359px) 100vw, 359px\" \/><\/a><\/p>\n<p>\u0412 \u0410\u0440\u0434\u0443\u0438\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u0430\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0447\u0435\u0440\u0435\u0437 \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u0435 \u0432\u044b\u0432\u043e\u0434\u044b 0 \u0438 1 (\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u0432\u044f\u0437\u0438 \u0441 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u043c \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c USB). \u0410\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u0432 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430, \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043f\u0440\u0438\u0435\u043c\u043e\u043f\u0435\u0440\u0435\u0434\u0430\u0442\u0447\u0438\u043a\u043e\u043c UART.\u00a0 \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 SoftwareSerial \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \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 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430 \u043b\u044e\u0431\u044b\u0445 \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u0445 \u0432\u044b\u0432\u043e\u0434\u0430\u0445 \u0410\u0440\u0434\u0443\u0438\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0445 \u0441\u0440\u0435\u0434\u0441\u0442\u0432, \u0434\u0443\u0431\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c UART.<\/p>\n<div id=\"marketWidget\"><\/div>\n<p><strong>\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u044f TTL \u2013 RS485:<\/strong><\/p>\n<ul>\n<li>\u041d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u043f\u0438\u0442\u0430\u043d\u0438\u044f \u2013 5 \u0412;<\/li>\n<li>\u0422\u043e\u043a \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u044f \u2013 10 \u043c\u0410;<\/li>\n<li>\u0422\u043e\u043a \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u044f \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u2013 5 \u043c\u0410;<\/li>\n<li>\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u2013 \u0434\u043e 2,5 \u041c\u0431\u0438\u0442\/\u0441;<\/li>\n<li>\u0420\u0430\u0431\u043e\u0447\u0430\u044f \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 \u2013 0-70 \u00b0\u0421;<\/li>\n<li>\u0420\u0430\u0437\u043c\u0435\u0440 \u2013 44x14x20 \u043c\u043c.<\/li>\n<\/ul>\n<p><strong>\u041d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432:<\/strong><\/p>\n<ul>\n<li>Vcc \u2013 \u043f\u0438\u0442\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f 5 \u0412;<\/li>\n<li>GND \u2013 \u0437\u0435\u043c\u043b\u044f;<\/li>\n<li>DI \u2013 \u0432\u0445\u043e\u0434 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u0447\u0438\u043a\u0430;<\/li>\n<li>RO \u2013 \u0432\u044b\u0445\u043e\u0434 \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a\u0430;<\/li>\n<li>DE \u2013 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u0447\u0438\u043a\u0430;<\/li>\n<li>RE \u2013 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a\u0430;<\/li>\n<li>A \u2013 \u043b\u0438\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438;<\/li>\n<li>B \u2013 \u043b\u0438\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438.<\/li>\n<\/ul>\n<p>\u0412\u044b\u0432\u043e\u0434\u044b DE \u0438 RE \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u043c\u043a\u043d\u0443\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439.<\/p>\n<p>\u0412\u044b\u0432\u043e\u0434\u044b \u043c\u043e\u0434\u0443\u043b\u044f A \u0438 B, \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u044b\u0432\u043e\u0434\u0430\u043c\u0438 \u043b\u0438\u043d\u0438\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u0441\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u043d\u0430 \u043b\u0438\u043d\u0438\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u044e\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0438\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u0432\u044b\u0432\u043e\u0434\u0430\u043c\u0438.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u0439 TTL \u2013 RS485 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0442 \u043e\u0434\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u044b Arduino \u043a \u0434\u0440\u0443\u0433\u043e\u0439. \u041a \u043f\u0435\u0440\u0432\u043e\u0439 \u043f\u043b\u0430\u0442\u0435 Arduino \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u0434\u0430\u0442\u0447\u0438\u043a \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b DS18B20 \u0438 \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u0447\u0435\u0440\u0435\u0437 \u043b\u0438\u043d\u0438\u044e \u0441\u0432\u044f\u0437\u0438 RS485 \u0432\u043e \u0432\u0442\u043e\u0440\u0443\u044e \u043f\u043b\u0430\u0442\u0443 Arduino. \u041a \u043f\u0435\u0440\u0432\u043e\u0439 \u043f\u043b\u0430\u0442\u0435 Arduino \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c, \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043f\u043e\u043c\u0438\u043c\u043e \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0447\u0438\u0441\u043b\u043e 12.<\/p>\n<p>\u0421\u043a\u0435\u0442\u0447 \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0439 \u043f\u043b\u0430\u0442\u044b Arduino (\u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0434\u0430\u043d\u043d\u044b\u0445)<\/p>\n<pre class=\"actionscript\" style=\"font-family: monospace; font-size: 10px;\"><span style=\"color: #808080; font-style: italic;\">#include &lt;SoftwareSerial.h&gt; \/\/ \u0412\u0445\u043e\u0434\u0438\u0442 \u0432 \u0441\u043e\u0441\u0442\u0430\u0432 Arduino IDE<\/span>\r\n<span style=\"color: #808080; font-style: italic;\">#include &lt;OneWire.h&gt; \/\/ http:\/\/rcl-radio.ru\/wp-content\/uploads\/2018\/07\/OneWire.zip<\/span>\r\n<span style=\"color: #808080; font-style: italic;\">#include &lt;DallasTemperature.h&gt; \/\/ http:\/\/rcl-radio.ru\/wp-content\/uploads\/2018\/07\/DallasTemperature.zip<\/span>\r\n  OneWire oneWire<span style=\"color: #66cc66;\">(<\/span>A0<span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #808080; font-style: italic;\">\/\/ \u0432\u0445\u043e\u0434 \u0434\u0430\u0442\u0447\u0438\u043a\u0430 18b20<\/span>\r\n  DallasTemperature temp<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">&amp;<\/span>oneWire<span style=\"color: #66cc66;\">)<\/span>;    \r\n  SoftwareSerial rs485<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">10<\/span>, <span style=\"color: #cc66cc;\">11<\/span><span style=\"color: #66cc66;\">)<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ RO \u0438 DI<\/span>\r\n\u00a0\r\n<span style=\"color: #0066cc;\">void<\/span> setup<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span> <span style=\"color: #66cc66;\">{<\/span>\r\n  rs485.<span style=\"color: #006600;\">begin<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">9600<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n  temp.<span style=\"color: #006600;\">begin<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>; \r\n  temp.<span style=\"color: #006600;\">setResolution<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">12<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #808080; font-style: italic;\">\/\/12 \u0431\u0438\u0442           <\/span>\r\n  pinMode<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">4<\/span>,OUTPUT<span style=\"color: #66cc66;\">)<\/span>;              \r\n  digitalWrite<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">4<\/span>,HIGH<span style=\"color: #66cc66;\">)<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ DE-RE \u043e\u043f\u0440\u0430\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/span>           \r\n<span style=\"color: #66cc66;\">}<\/span>\r\n\u00a0\r\n<span style=\"color: #0066cc;\">void<\/span> loop<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span> <span style=\"color: #66cc66;\">{<\/span> \r\n    temp.<span style=\"color: #006600;\">requestTemperatures<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n    <span style=\"color: #0066cc;\">int<\/span> t = temp.<span style=\"color: #006600;\">getTempCByIndex<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">*<\/span><span style=\"color: #cc66cc;\">10<\/span>;\r\n    rs485.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">100000<\/span>+t<span style=\"color: #66cc66;\">)<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ 1 - \u043a\u043e\u0434 \u0434\u0430\u0442\u0447\u0438\u043a\u0430<\/span>\r\n    delay<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1000<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n    rs485.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">200012<\/span><span style=\"color: #66cc66;\">)<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ 2 - \u043a\u043e\u0434 \u0434\u0430\u0442\u0447\u0438\u043a\u0430<\/span>\r\n    delay<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1000<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n<span style=\"color: #66cc66;\">}<\/span><span style=\"color: #808080; font-style: italic;\">\/\/loop<\/span><\/pre>\n<p>\u0421\u043a\u0435\u0442\u0447 \u0434\u043b\u044f \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u043b\u0430\u0442\u044b Arduino (\u043f\u0440\u0438\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445)<\/p>\n<pre class=\"actionscript\" style=\"font-family: monospace; font-size: 10px;\"><span style=\"color: #808080; font-style: italic;\">#include &lt;SoftwareSerial.h&gt;   \/\/ \u0412\u0445\u043e\u0434\u0438\u0442 \u0432 \u0441\u043e\u0441\u0442\u0430\u0432 Arduino IDE<\/span>\r\nSoftwareSerial rs485<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">10<\/span>, <span style=\"color: #cc66cc;\">11<\/span><span style=\"color: #66cc66;\">)<\/span>;  <span style=\"color: #808080; font-style: italic;\">\/\/ RO \u0438 DI               <\/span>\r\nlong buff;\r\n\u00a0\r\n<span style=\"color: #0066cc;\">void<\/span> setup<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span> <span style=\"color: #66cc66;\">{<\/span>\r\n  Serial.<span style=\"color: #006600;\">begin<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">9600<\/span><span style=\"color: #66cc66;\">)<\/span>;     \r\n  rs485.<span style=\"color: #006600;\">begin<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">9600<\/span><span style=\"color: #66cc66;\">)<\/span>; \r\n  pinMode<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">4<\/span>,OUTPUT<span style=\"color: #66cc66;\">)<\/span>;               \r\n  digitalWrite<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">4<\/span>,LOW<span style=\"color: #66cc66;\">)<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ DE-RE \u043f\u0440\u0438\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445<\/span>\r\n<span style=\"color: #66cc66;\">}<\/span>\r\n\u00a0\r\n<span style=\"color: #0066cc;\">void<\/span> loop<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span> <span style=\"color: #66cc66;\">{<\/span>\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span> rs485.<span style=\"color: #006600;\">available<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span> <span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>\r\n    delay<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">5<\/span><span style=\"color: #66cc66;\">)<\/span>; \r\n  <span style=\"color: #b1b100;\">while<\/span><span style=\"color: #66cc66;\">(<\/span> rs485.<span style=\"color: #006600;\">available<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">&gt;<\/span><span style=\"color: #cc66cc;\">0<\/span> <span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span> \r\n      buff = rs485.<span style=\"color: #0066cc;\">parseInt<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n\u00a0\r\n      <span style=\"color: #0066cc;\">int<\/span> i = buff<span style=\"color: #66cc66;\">\/<\/span><span style=\"color: #cc66cc;\">100000<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u0434\u0430\u0442\u0447\u0438\u043a\u0430<\/span>\r\n\u00a0\r\n      <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>i==<span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>  <span style=\"color: #808080; font-style: italic;\">\/\/ \u0435\u0441\u043b\u0438 \u043a\u043e\u0434 \u0434\u0430\u0442\u0447\u0438\u043a\u0430 \u0432\u0435\u0440\u0435\u043d, \u0442\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/span>\r\n      float t = float<span style=\"color: #66cc66;\">(<\/span>buff-<span style=\"color: #cc66cc;\">100000<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">\/<\/span><span style=\"color: #cc66cc;\">10<\/span>;\r\n      Serial.<span style=\"color: #006600;\">println<\/span><span style=\"color: #66cc66;\">(<\/span>t,<span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span>\r\n\u00a0\r\n      <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>i==<span style=\"color: #cc66cc;\">2<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>Serial.<span style=\"color: #006600;\">println<\/span><span style=\"color: #66cc66;\">(<\/span>buff-<span style=\"color: #cc66cc;\">200000<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span>          \r\n  <span style=\"color: #66cc66;\">}<\/span><span style=\"color: #66cc66;\">}<\/span>\r\n<span style=\"color: #66cc66;\">}<\/span><span style=\"color: #808080; font-style: italic;\">\/\/loop<\/span><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043c\u043e\u043d\u0438\u0442\u043e\u0440 \u043f\u043e\u0440\u0442\u0430 (\u0441\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u043b\u0430\u0442\u044b Arduino)<\/p>\n<p><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/06\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-06-07-163123.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-80039\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/06\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-06-07-163123.png\" alt=\"\" width=\"346\" height=\"331\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/06\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-06-07-163123.png 346w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/06\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-06-07-163123-200x191.png 200w\" sizes=\"auto, (max-width: 346px) 100vw, 346px\" \/><\/a><\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u043d\u0430 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0435, \u0432 \u043c\u043e\u043d\u0438\u0442\u043e\u0440 \u043f\u043e\u0440\u0442\u0430 \u043f\u043e\u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u0438 \u0447\u0438\u0441\u043b\u043e 12 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0441 \u043f\u0435\u0440\u0432\u043e\u0439 \u043f\u043b\u0430\u0442\u044b Arduino.<\/p>\n<hr \/>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u0439 TTL \u2013 RS485 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0442\u0435\u0440\u043c\u043e\u0440\u0435\u0433\u0443\u043b\u044f\u0442\u043e\u0440\u0430. \u041f\u0435\u0440\u0432\u0430\u044f \u043f\u043b\u0430\u0442\u0430 Arduino \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0432\u044b\u043c \u043c\u043e\u0434\u0443\u043b\u0435\u043c TTL \u2013 RS485, \u0441\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0433\u043e \u0434\u0430\u0442\u0447\u0438\u043a\u0430 DS18B20 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044f \u0440\u0435\u043b\u0435 (\u0432\u044b\u0445\u043e\u0434 D13). \u041a\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u043b\u0430\u0442\u0435 Arduino \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u044b LCD1602 \u044d\u043a\u0440\u0430\u043d (\u0447\u0435\u0440\u0435\u0437 I2C \u043c\u043e\u0434\u0443\u043b\u044c PCF8574) \u0438 \u0434\u0432\u0435 \u043a\u043d\u043e\u043f\u043a\u0438, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0443 \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/06\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-06-14-181913.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-80334\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/06\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-06-14-181913.png\" alt=\"\" width=\"472\" height=\"206\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/06\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-06-14-181913.png 472w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/06\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-06-14-181913-200x87.png 200w\" sizes=\"auto, (max-width: 472px) 100vw, 472px\" \/><\/a> <a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/06\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-06-14-181908.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-80335\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/06\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-06-14-181908.png\" alt=\"\" width=\"525\" height=\"168\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/06\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-06-14-181908.png 525w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/06\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-06-14-181908-200x64.png 200w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/06\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-06-14-181908-500x160.png 500w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/a><\/p>\n<p>\u041c\u043e\u0434\u0443\u043b\u0438 TTL \u2013 RS485 \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u043a\u0430\u043a \u043d\u0430 \u043f\u0440\u0438\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u0430\u043a \u0438 \u043d\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u0440\u0438 \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u0435 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b, \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f\u00a0 \u043e \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0435 \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u043b\u0430\u0442\u044b Arduino \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0435\u0440\u0432\u0443\u044e \u043f\u043b\u0430\u0442\u0443, \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0435 \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u043b\u0438 \u043d\u0430 \u043f\u0435\u0440\u0432\u0443\u044e \u043f\u043b\u0430\u0442\u0443, \u043e\u043d\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432\u043e \u0432\u0442\u043e\u0440\u0443\u044e \u043f\u043b\u0430\u0442\u0443 \u0434\u043b\u044f \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f \u0443\u0434\u0430\u0447\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u0435\u043c\u0430 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041f\u0440\u0438 \u043d\u0435 \u0443\u0434\u0430\u0447\u043d\u043e\u043c \u043f\u0440\u0438\u0435\u043c\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0431 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0435 \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0432\u0442\u043e\u0440\u0430\u044f \u043f\u043b\u0430\u0442\u0430 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u043d\u0443\u044e \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0443 \u043e\u0442 \u043f\u0435\u0440\u0432\u043e\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c\u0441\u044f \u0434\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f \u043e\u0442 \u043f\u0435\u0440\u0432\u043e\u0439 \u043f\u043b\u0430\u0442\u044b.<\/p>\n<p><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/06\/rs485.gif\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-80336\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/06\/rs485.gif\" alt=\"\" width=\"716\" height=\"706\" \/><\/a><\/p>\n<p>\u0421\u043a\u0435\u0442\u0447 \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0439 \u043f\u043b\u0430\u0442\u044b<\/p>\n<pre class=\"actionscript\" style=\"font-family: monospace; font-size: 10px;\"><span style=\"color: #808080; font-style: italic;\">#include &lt;DallasTemperature.h&gt; \/\/ http:\/\/rcl-radio.ru\/wp-content\/uploads\/2018\/07\/DallasTemperature.zip\r\n#include &lt;SoftwareSerial.h&gt; \/\/ \u0412\u0445\u043e\u0434\u0438\u0442 \u0432 \u0441\u043e\u0441\u0442\u0430\u0432 Arduino IDE<\/span> \r\n<span style=\"color: #808080; font-style: italic;\">#include &lt;OneWire.h&gt; \/\/ http:\/\/rcl-radio.ru\/wp-content\/uploads\/2018\/07\/OneWire.zip<\/span> <span style=\"color: #808080; font-style: italic;\">#include &lt;DallasTemperature.h&gt; \/\/ http:\/\/rcl-radio.ru\/wp-content\/uploads\/2018\/07\/DallasTemperature.zip<\/span>\r\n<span style=\"color: #808080; font-style: italic;\">#include &lt;EEPROM.h&gt; \/\/ \u0412\u0445\u043e\u0434\u0438\u0442 \u0432 \u0441\u043e\u0441\u0442\u0430\u0432 Arduino IDE\u00a0<\/span>\r\n  OneWire oneWire<span style=\"color: #66cc66;\">(<\/span>A0<span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #808080; font-style: italic;\">\/\/ \u0432\u0445\u043e\u0434 \u0434\u0430\u0442\u0447\u0438\u043a\u0430 18b20<\/span>\r\n  DallasTemperature temp<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">&amp;<\/span>oneWire<span style=\"color: #66cc66;\">)<\/span>;    \r\n  SoftwareSerial rs485<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">10<\/span>, <span style=\"color: #cc66cc;\">11<\/span><span style=\"color: #66cc66;\">)<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ RO \u0438 DI<\/span>\r\n\u00a0\r\n  <span style=\"color: #0066cc;\">int<\/span> r,t,w;\r\n  long buff;\r\n\u00a0\r\n<span style=\"color: #0066cc;\">void<\/span> setup<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span> <span style=\"color: #66cc66;\">{<\/span>\r\n  rs485.<span style=\"color: #006600;\">begin<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">9600<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n  temp.<span style=\"color: #006600;\">begin<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>; \r\n  temp.<span style=\"color: #006600;\">setResolution<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">12<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #808080; font-style: italic;\">\/\/12 \u0431\u0438\u0442           <\/span>\r\n  pinMode<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">4<\/span>,OUTPUT<span style=\"color: #66cc66;\">)<\/span>;              \r\n  pinMode<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">13<\/span>,OUTPUT<span style=\"color: #66cc66;\">)<\/span>;  \r\n  r=EEPROM.<span style=\"color: #006600;\">read<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">)<\/span>;   \r\n<span style=\"color: #66cc66;\">}<\/span>\r\n\u00a0\r\n<span style=\"color: #0066cc;\">void<\/span> loop<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span> <span style=\"color: #66cc66;\">{<\/span> \r\n  <span style=\"color: #808080; font-style: italic;\">\/\/\/\/\/\/\/\/\/ \u043f\u0440\u0438\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445<\/span>\r\n  digitalWrite<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">4<\/span>,LOW<span style=\"color: #66cc66;\">)<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ DE-RE \u043f\u0440\u0438\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445<\/span>\r\n  delay<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">300<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span> rs485.<span style=\"color: #006600;\">available<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span> <span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>\r\n  <span style=\"color: #b1b100;\">while<\/span><span style=\"color: #66cc66;\">(<\/span> rs485.<span style=\"color: #006600;\">available<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">&gt;<\/span><span style=\"color: #cc66cc;\">0<\/span> <span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>buff = rs485.<span style=\"color: #0066cc;\">parseInt<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span>\r\n   <span style=\"color: #0066cc;\">int<\/span> i = buff<span style=\"color: #66cc66;\">\/<\/span><span style=\"color: #cc66cc;\">1000<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u0434\u0430\u0442\u0447\u0438\u043a\u0430<\/span>\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>i==<span style=\"color: #cc66cc;\">3<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>r = buff-<span style=\"color: #cc66cc;\">3000<\/span>;<span style=\"color: #66cc66;\">}<\/span><span style=\"color: #66cc66;\">}<\/span> \r\n  <span style=\"color: #b1b100;\">else<\/span><span style=\"color: #66cc66;\">{<\/span>\r\n    <span style=\"color: #808080; font-style: italic;\">\/\/\/\/\/\/\/\/\/ \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445  <\/span>\r\n  digitalWrite<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">4<\/span>,HIGH<span style=\"color: #66cc66;\">)<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ DE-RE \u043e\u043f\u0440\u0430\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 <\/span>\r\n\u00a0\r\n    temp.<span style=\"color: #006600;\">requestTemperatures<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n    t = temp.<span style=\"color: #006600;\">getTempCByIndex<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">*<\/span><span style=\"color: #cc66cc;\">10<\/span>;\r\n\u00a0\r\n    rs485.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1000<\/span> + t<span style=\"color: #66cc66;\">)<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ 1 - \u043a\u043e\u0434 \u0434\u0430\u0442\u0447\u0438\u043a\u0430<\/span>\r\n    delay<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1000<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n    rs485.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">2000<\/span> + r<span style=\"color: #66cc66;\">)<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ 2 - \u043a\u043e\u0434 \u0434\u0430\u0442\u0447\u0438\u043a\u0430<\/span>\r\n    delay<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1000<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n    EEPROM.<span style=\"color: #006600;\">update<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">0<\/span>,r<span style=\"color: #66cc66;\">)<\/span>;\r\n  <span style=\"color: #66cc66;\">}<\/span>\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>r <span style=\"color: #66cc66;\">&gt;<\/span>= t<span style=\"color: #66cc66;\">\/<\/span><span style=\"color: #cc66cc;\">10<\/span> + <span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>digitalWrite<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">13<\/span>,HIGH<span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span>\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>r <span style=\"color: #66cc66;\">&lt;<\/span>= t<span style=\"color: #66cc66;\">\/<\/span><span style=\"color: #cc66cc;\">10<\/span> - <span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>digitalWrite<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">13<\/span>,LOW<span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span>\r\n<span style=\"color: #66cc66;\">}<\/span><span style=\"color: #808080; font-style: italic;\">\/\/loop<\/span><\/pre>\n<p>\u0421\u043a\u0435\u0442\u0447 \u0434\u043b\u044f \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u043b\u0430\u0442\u044b<\/p>\n<pre class=\"actionscript\" style=\"font-family: monospace; font-size: 10px;\"><span style=\"color: #808080; font-style: italic;\">#include &lt;SoftwareSerial.h&gt;   \/\/ \u0412\u0445\u043e\u0434\u0438\u0442 \u0432 \u0441\u043e\u0441\u0442\u0430\u0432 Arduino IDE  <\/span>\r\n<span style=\"color: #808080; font-style: italic;\">#include &lt;Wire.h&gt; \/\/ \u0412\u0445\u043e\u0434\u0438\u0442 \u0432 \u0441\u043e\u0441\u0442\u0430\u0432 Arduino IDE\u00a0<\/span>\r\n<span style=\"color: #808080; font-style: italic;\">#include &lt;EEPROM.h&gt;  \/\/ \u0412\u0445\u043e\u0434\u0438\u0442 \u0432 \u0441\u043e\u0441\u0442\u0430\u0432 Arduino IDE\u00a0<\/span>\r\n<span style=\"color: #808080; font-style: italic;\">#include &lt;LiquidCrystal_I2C.h&gt; \/\/\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 - http:\/\/forum.rcl-radio.ru\/misc.php?action=pan_download&amp;item=45&amp;download=1<\/span>\r\n LiquidCrystal_I2C lcd<span style=\"color: #66cc66;\">(<\/span>0x27,<span style=\"color: #cc66cc;\">16<\/span>,<span style=\"color: #cc66cc;\">2<\/span><span style=\"color: #66cc66;\">)<\/span>;  <span style=\"color: #808080; font-style: italic;\">\/\/ \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0434\u0438\u0441\u043f\u043b\u0435\u0439<\/span>\r\n SoftwareSerial rs485<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">10<\/span>, <span style=\"color: #cc66cc;\">11<\/span><span style=\"color: #66cc66;\">)<\/span>;  <span style=\"color: #808080; font-style: italic;\">\/\/ RO \u0438 DI               <\/span>\r\n long buff;\r\n float t;\r\n <span style=\"color: #0066cc;\">int<\/span> reg,r,w=<span style=\"color: #cc66cc;\">1<\/span>,w1=<span style=\"color: #cc66cc;\">1<\/span>;\r\n\u00a0\r\n<span style=\"color: #0066cc;\">void<\/span> setup<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span> <span style=\"color: #66cc66;\">{<\/span>\r\n  Serial.<span style=\"color: #006600;\">begin<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">9600<\/span><span style=\"color: #66cc66;\">)<\/span>;     \r\n  rs485.<span style=\"color: #006600;\">begin<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">9600<\/span><span style=\"color: #66cc66;\">)<\/span>; \r\n  pinMode <span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">7<\/span>,INPUT_PULLUP<span style=\"color: #66cc66;\">)<\/span>;\r\n  pinMode <span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">8<\/span>,INPUT_PULLUP<span style=\"color: #66cc66;\">)<\/span>;\r\n  lcd.<span style=\"color: #006600;\">init<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;                     \r\n  lcd.<span style=\"color: #006600;\">backlight<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #808080; font-style: italic;\">\/\/ \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u0443 \u0434\u0438\u0441\u043f\u043b\u0435\u044f<\/span>\r\n  pinMode<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">4<\/span>,OUTPUT<span style=\"color: #66cc66;\">)<\/span>;                \r\n  reg = EEPROM.<span style=\"color: #006600;\">read<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n<span style=\"color: #66cc66;\">}<\/span>\r\n\u00a0\r\n<span style=\"color: #0066cc;\">void<\/span> loop<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span> <span style=\"color: #66cc66;\">{<\/span>\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>digitalRead<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">7<\/span><span style=\"color: #66cc66;\">)<\/span>==LOW<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>reg++;w=<span style=\"color: #cc66cc;\">1<\/span>;w1=<span style=\"color: #cc66cc;\">1<\/span>;<span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>reg<span style=\"color: #66cc66;\">&gt;<\/span><span style=\"color: #cc66cc;\">125<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>reg=<span style=\"color: #cc66cc;\">125<\/span>;<span style=\"color: #66cc66;\">}<\/span><span style=\"color: #66cc66;\">}<\/span>\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>digitalRead<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">8<\/span><span style=\"color: #66cc66;\">)<\/span>==LOW<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>reg--;w=<span style=\"color: #cc66cc;\">1<\/span>;w1=<span style=\"color: #cc66cc;\">1<\/span>;<span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>reg<span style=\"color: #66cc66;\">&lt;<\/span><span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>reg=<span style=\"color: #cc66cc;\">0<\/span>;<span style=\"color: #66cc66;\">}<\/span><span style=\"color: #66cc66;\">}<\/span>\r\n\u00a0\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>w1==<span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>\r\n    lcd.<span style=\"color: #006600;\">setCursor<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">0<\/span>, <span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">)<\/span>;lcd.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #ff0000;\">\"REG = \"<\/span><span style=\"color: #66cc66;\">)<\/span>;lcd.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span>reg<span style=\"color: #66cc66;\">)<\/span>;lcd.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">(<\/span>char<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #cc66cc;\">223<\/span><span style=\"color: #66cc66;\">)<\/span>;lcd.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #ff0000;\">\"C\"<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n    w1=<span style=\"color: #cc66cc;\">0<\/span>;delay<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">200<\/span><span style=\"color: #66cc66;\">)<\/span>;EEPROM.<span style=\"color: #006600;\">update<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">0<\/span>,reg<span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span>\r\n    <span style=\"color: #b1b100;\">else<\/span><span style=\"color: #66cc66;\">{<\/span>\r\n\u00a0\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>w==<span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>\r\n  <span style=\"color: #808080; font-style: italic;\">\/\/\/\/\/\/\/\/\/ \u043f\u0440\u0438\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445<\/span>\r\n  digitalWrite<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">4<\/span>,LOW<span style=\"color: #66cc66;\">)<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ DE-RE \u043f\u0440\u0438\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445<\/span>\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span> rs485.<span style=\"color: #006600;\">available<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span> <span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span> \r\n  <span style=\"color: #b1b100;\">while<\/span><span style=\"color: #66cc66;\">(<\/span> rs485.<span style=\"color: #006600;\">available<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">&gt;<\/span><span style=\"color: #cc66cc;\">0<\/span> <span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>buff = rs485.<span style=\"color: #0066cc;\">parseInt<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span>\r\n\u00a0\r\n      <span style=\"color: #0066cc;\">int<\/span> i = buff<span style=\"color: #66cc66;\">\/<\/span><span style=\"color: #cc66cc;\">1000<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u0434\u0430\u0442\u0447\u0438\u043a\u0430<\/span>\r\n\u00a0\r\n      <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>i==<span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>t = float<span style=\"color: #66cc66;\">(<\/span>buff-<span style=\"color: #cc66cc;\">1000<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">\/<\/span><span style=\"color: #cc66cc;\">10<\/span>;<span style=\"color: #66cc66;\">}<\/span>\r\n      <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>i==<span style=\"color: #cc66cc;\">2<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>r = buff-<span style=\"color: #cc66cc;\">2000<\/span>;<span style=\"color: #66cc66;\">}<\/span> \r\n      <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>r<span style=\"color: #66cc66;\">!<\/span>=reg<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>w=<span style=\"color: #cc66cc;\">1<\/span>;<span style=\"color: #66cc66;\">}<\/span>         \r\n\u00a0\r\n  lcd.<span style=\"color: #006600;\">setCursor<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">0<\/span>, <span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">)<\/span>;lcd.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #ff0000;\">\"T = \"<\/span><span style=\"color: #66cc66;\">)<\/span>;lcd.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span>t,<span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">)<\/span>;lcd.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">(<\/span>char<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #cc66cc;\">223<\/span><span style=\"color: #66cc66;\">)<\/span>;lcd.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #ff0000;\">\"C\"<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n  lcd.<span style=\"color: #006600;\">setCursor<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">12<\/span>, <span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>r <span style=\"color: #66cc66;\">&gt;<\/span>= t + <span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>lcd.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #ff0000;\">\"OFF\"<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span><span style=\"color: #b1b100;\">else<\/span><span style=\"color: #66cc66;\">{<\/span>lcd.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #ff0000;\">\"ON \"<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span>\r\n\u00a0\r\n  lcd.<span style=\"color: #006600;\">setCursor<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">0<\/span>, <span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">)<\/span>;lcd.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #ff0000;\">\"REG = \"<\/span><span style=\"color: #66cc66;\">)<\/span>;lcd.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span>reg<span style=\"color: #66cc66;\">)<\/span>;lcd.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">(<\/span>char<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #cc66cc;\">223<\/span><span style=\"color: #66cc66;\">)<\/span>;lcd.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #ff0000;\">\"C\"<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n  lcd.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #ff0000;\">\" (\"<\/span><span style=\"color: #66cc66;\">)<\/span>;lcd.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span>r<span style=\"color: #66cc66;\">)<\/span>;lcd.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #ff0000;\">\")  \"<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n  <span style=\"color: #66cc66;\">}<\/span>\r\n  <span style=\"color: #66cc66;\">}<\/span>\r\n\u00a0\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>w==<span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>\r\n     <span style=\"color: #808080; font-style: italic;\">\/\/\/\/\/\/\/\/\/ \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445  <\/span>\r\n  digitalWrite<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">4<\/span>,HIGH<span style=\"color: #66cc66;\">)<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ DE-RE \u043e\u043f\u0440\u0430\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 <\/span>\r\n\u00a0\r\n  rs485.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">3000<\/span> + reg<span style=\"color: #66cc66;\">)<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ 3 - \u043a\u043e\u0434 \u0434\u0430\u0442\u0447\u0438\u043a\u0430<\/span>\r\n  delay<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">100<\/span><span style=\"color: #66cc66;\">)<\/span>;w=<span style=\"color: #cc66cc;\">0<\/span>;<span style=\"color: #66cc66;\">}<\/span><span style=\"color: #808080; font-style: italic;\">\/\/ w=1<\/span>\r\n    <span style=\"color: #66cc66;\">}<\/span>\r\n<span style=\"color: #66cc66;\">}<\/span><span style=\"color: #808080; font-style: italic;\">\/\/loop<\/span><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>RS485 \u2014 \u044d\u0442\u043e \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 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u043b\u0438\u043d\u0430 \u043b\u0438\u043d\u0438\u0438 \u043f\u0440\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0438 \u043f\u043e RS485 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 1200 \u043c\u0435\u0442\u0440\u043e\u0432. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u0430\u0431\u0435\u043b\u044f \u0434\u043b\u044f RS485 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u0438\u0442\u0430\u044f \u043f\u0430\u0440\u0430. \u042d\u0442\u043e \u0434\u0432\u0430 \u043f\u0440\u043e\u0432\u043e\u0434\u0430, \u0441\u043f\u043b\u0435\u0442\u0435\u043d\u043d\u044b\u0435 \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c. \u0427\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0434\u0438\u0441\u0442\u0430\u043d\u0446\u0438\u0438 \u0431\u043e\u043b\u0435\u0435 500 \u043c\u0435\u0442\u0440\u043e\u0432, \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0432\u0438\u0442\u0430\u044f \u043f\u0430\u0440\u0430. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0434\u0432\u0435 \u043f\u043b\u0430\u0442\u044b \u0410\u0440\u0434\u0443\u0438\u043d\u043e \u043f\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443 RS485 \u043d\u0430\u043c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":80038,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[239,15],"tags":[],"class_list":["post-80037","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino","category-15"],"views":6805,"_links":{"self":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/80037","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=80037"}],"version-history":[{"count":7,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/80037\/revisions"}],"predecessor-version":[{"id":111244,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/80037\/revisions\/111244"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/media\/80038"}],"wp:attachment":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=80037"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=80037"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=80037"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}