{"id":76072,"date":"2020-03-07T21:54:06","date_gmt":"2020-03-07T15:54:06","guid":{"rendered":"http:\/\/rcl-radio.ru\/?p=76072"},"modified":"2022-01-08T20:40:50","modified_gmt":"2022-01-08T14:40:50","slug":"%d1%87%d0%b0%d1%81%d1%8b-%d1%81-%d0%b1%d1%83%d0%b4%d0%b8%d0%bb%d1%8c%d0%bd%d0%b8%d0%ba%d0%be%d0%bc-tm1637-stm32-arduino","status":"publish","type":"post","link":"http:\/\/rcl-radio.ru\/?p=76072","title":{"rendered":"\u0427\u0430\u0441\u044b \u0441 \u0431\u0443\u0434\u0438\u043b\u044c\u043d\u0438\u043a\u043e\u043c + TM1637 + STM32 (Arduino)"},"content":{"rendered":"<p><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/03\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-03-07-214352.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-76074\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/03\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-03-07-214352.png\" alt=\"\" width=\"327\" height=\"185\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/03\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-03-07-214352.png 327w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/03\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-03-07-214352-200x113.png 200w\" sizes=\"auto, (max-width: 327px) 100vw, 327px\" \/><\/a><\/p>\n<p>\u041d\u0430 \u0431\u0430\u0437\u0435 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u044b STM32 (\u0431\u0430\u0437\u0435 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 STM32F103C8T6) \u0438 <a href=\"http:\/\/rcl-radio.ru\/?p=75892\">\u0441\u0435\u043c\u0438\u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043d\u043e\u043c \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u043c \u0434\u0438\u0441\u043f\u043b\u0435\u0435 TM1637<\/a> \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0447\u0430\u0441\u044b \u0441 \u0431\u0443\u0434\u0438\u043b\u044c\u043d\u0438\u043a\u043e\u043c. \u0412 \u0443\u0441\u0442-\u0432\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0447\u0430\u0441\u044b \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 DS3231 (DS1307).<\/p>\n<div id=\"marketWidget\"><\/div>\n<p><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/03\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-03-07-214030.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-76073\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/03\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-03-07-214030.png\" alt=\"\" width=\"1025\" height=\"550\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/03\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-03-07-214030.png 1025w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/03\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-03-07-214030-200x107.png 200w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/03\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-03-07-214030-500x268.png 500w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/03\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-03-07-214030-768x412.png 768w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/03\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-03-07-214030-1024x549.png 1024w\" sizes=\"auto, (max-width: 1025px) 100vw, 1025px\" \/><\/a><\/p>\n<p>\u0427\u0430\u0441\u044b \u0441 \u0431\u0443\u0434\u0438\u043b\u044c\u043d\u0438\u043a\u043e\u043c \u0438\u043c\u0435\u044e\u0442 \u0447\u0435\u0442\u044b\u0440\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u044f, \u0432\u0440\u0435\u043c\u044f \u0431\u0443\u0434\u0438\u043b\u044c\u043d\u0438\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u044f\u0440\u043a\u043e\u0441\u0442\u044c \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u0430. \u042f\u0440\u043a\u043e\u0441\u0442\u044c \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0438 \u0432\u0440\u0435\u043c\u044f \u0431\u0443\u0434\u0438\u043b\u044c\u043d\u0438\u043a\u0430 \u0437\u0430\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u0432 \u044d\u043d\u0435\u0440\u0433\u043e\u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c. \u041f\u0440\u0438 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0438 \u0431\u0443\u0434\u0438\u043b\u044c\u043d\u0438\u043a\u0430 \u0438\u0437 \u043f\u044c\u0435\u0437\u043e\u0438\u0437\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044f \u0440\u0430\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0437\u0432\u0443\u043a\u043e\u0432\u043e\u0439 \u0441\u0438\u0433\u043d\u0430\u043b, \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0437\u0432\u0443\u043a\u043e\u0432\u043e\u0433\u043e \u0441\u0438\u0433\u043d\u0430\u043b\u0430 1 \u043c\u0438\u043d\u0443\u0442\u0430, \u043f\u0440\u0435\u0440\u0432\u0430\u0442\u044c \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u0443\u0442\u0435\u043c \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043d\u0430 \u043b\u044e\u0431\u0443\u044e \u043a\u043d\u043e\u043f\u043a\u0443.<\/p>\n<p>\u0414\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0446\u0438\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0431\u0443\u0434\u0438\u043b\u044c\u043d\u0438\u043a\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0436\u0430\u0442\u044c \u0438 \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 \u043a\u043e\u0440\u0440\u0435\u043a\u0446\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438\u043b\u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0446\u0438\u044f \u0431\u0443\u0434\u0438\u043b\u044c\u043d\u0438\u043a\u0430 \u0438 \u043a\u043d\u043e\u043f\u043a\u0430\u043c\u0438 \u0447\u0430\u0441\u044b++ \u0438 \u043c\u0438\u043d\u0443\u0442\u044b ++ \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f (\u0434\u043b\u044f \u0442\u043e\u0447\u043d\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u0435\u043a\u0443\u043d\u0434, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u043c\u0438\u043d\u0443\u0442\u044b \u043d\u0430 1 \u043c\u0438\u043d\u0443\u0442\u0443 \u0431\u043e\u043b\u044c\u0448\u0435, \u043f\u0440\u0438 \u0441\u043c\u0435\u043d\u0435 \u043c\u0438\u043d\u0443\u0442\u044b \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 &#171;\u041a\u043e\u0440\u0440\u0435\u043a\u0446\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438&#187; \u0434\u043b\u044f \u043e\u0431\u043d\u0443\u043b\u0435\u043d\u0438\u044f \u0441\u0435\u043a\u0443\u043d\u0434 ).<\/p>\n<p>\u0427\u0430\u0441\u044b \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 DS3231 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0434\u0430\u0442\u0447\u0438\u043a \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b, \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0434\u0430\u0442\u0447\u0438\u043a\u0430 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u0432\u044b\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043d\u0430 \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440 \u043a\u0430\u0436\u0434\u044b\u0435 10 \u0441\u0435\u043a\u0443\u043d\u0434.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0437\u0430\u043b\u0438\u0432\u043a\u043e\u0439 \u0441\u043a\u0435\u0442\u0447\u0430 \u0432 STM32 \u0412\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u2014\u00a0<a href=\"http:\/\/rcl-radio.ru\/?p=68376\">STM32 Arduino IDE<\/a><\/p>\n<pre class=\"actionscript\" style=\"font-family: monospace; font-size: 10px;\"><span style=\"color: #808080; font-style: italic;\">#include &lt;Wire.h&gt;<\/span>\r\n<span style=\"color: #808080; font-style: italic;\">#include &lt;STM32_TM1637.h&gt;                \/\/ http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/02\/STM32_TM1637_V1_3.zip<\/span>\r\n<span style=\"color: #808080; font-style: italic;\">#include &lt;uRTCLib.h&gt;                     \/\/ https:\/\/github.com\/Naguissa\/uRTCLib.git<\/span>\r\n<span style=\"color: #808080; font-style: italic;\">#include &lt;EEPROM.h&gt;                      \/\/ http:\/\/rcl-radio.ru\/wp-content\/uploads\/2019\/12\/Arduino_STM32-master.zip<\/span>\r\n   STM32_TM1637 tm<span style=\"color: #66cc66;\">(<\/span>PB0,PB1<span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #808080; font-style: italic;\">\/\/ CLK, DIO<\/span>\r\n   uRTCLib rtc<span style=\"color: #66cc66;\">(<\/span>0x68<span style=\"color: #66cc66;\">)<\/span>;       \r\n\u00a0\r\n   <span style=\"color: #808080; font-style: italic;\">\/\/ PB7 = SDA DS1307 (DS3231) <\/span>\r\n   <span style=\"color: #808080; font-style: italic;\">\/\/ PB6 = SCL DS1307 (DS3231)<\/span>\r\n   <span style=\"color: #808080; font-style: italic;\">\/\/ PB0 = CLK TM1637<\/span>\r\n   <span style=\"color: #808080; font-style: italic;\">\/\/ PB1 = DIO TM1637<\/span>\r\n   <span style=\"color: #808080; font-style: italic;\">\/\/ PB5 = \u043a\u043e\u0440\u0440\u0435\u043a\u0446\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438<\/span>\r\n   <span style=\"color: #808080; font-style: italic;\">\/\/ PB10 = \u0447\u0430\u0441\u044b++, \u044f\u0440\u043a\u043e\u0441\u0442\u044c++<\/span>\r\n   <span style=\"color: #808080; font-style: italic;\">\/\/ PB11 = \u043c\u0438\u043d\u0443\u0442\u044b++, \u044f\u0440\u043a\u043e\u0441\u0442\u044c--<\/span>\r\n   <span style=\"color: #808080; font-style: italic;\">\/\/ PA7 = \u043a\u043e\u0440\u0440\u0435\u043a\u0446\u0438\u044f \u0431\u0443\u0434\u0438\u043b\u044c\u043d\u0438\u043a\u0430<\/span>\r\n   <span style=\"color: #808080; font-style: italic;\">\/\/ PA1 = \u043f\u044c\u0435\u0437\u043e\u0438\u0437\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044c<\/span>\r\n\u00a0\r\nfloat h;\r\n<span style=\"color: #0066cc;\">int<\/span> i,hh,mm,brig,al_hh,al_mm;\r\nbyte w,alarm,w1;\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   Wire.<span style=\"color: #006600;\">begin<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n   EEPROM.<span style=\"color: #006600;\">init<\/span><span style=\"color: #66cc66;\">(<\/span>0x801F000,0x801F800,0x400<span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #808080; font-style: italic;\">\/\/ 1024 byte<\/span>\r\n   brig = EEPROM.<span style=\"color: #006600;\">read<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">10<\/span><span style=\"color: #66cc66;\">)<\/span>;al_hh = EEPROM.<span style=\"color: #006600;\">read<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">11<\/span><span style=\"color: #66cc66;\">)<\/span>;al_mm = EEPROM.<span style=\"color: #006600;\">read<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">12<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n  <span style=\"color: #808080; font-style: italic;\">\/\/ rtc.set(30, 37, 23, 2, 17, 12, 19);<\/span>\r\n  <span style=\"color: #808080; font-style: italic;\">\/\/ RTCLib::set(byte second, byte minute, byte hour, byte dayOfWeek, byte dayOfMonth, byte month, byte year)<\/span>\r\n  pinMode<span style=\"color: #66cc66;\">(<\/span>PB5,INPUT<span style=\"color: #66cc66;\">)<\/span>;pinMode<span style=\"color: #66cc66;\">(<\/span>PB10,INPUT<span style=\"color: #66cc66;\">)<\/span>;pinMode<span style=\"color: #66cc66;\">(<\/span>PB11,INPUT<span style=\"color: #66cc66;\">)<\/span>;pinMode<span style=\"color: #66cc66;\">(<\/span>PA7,INPUT<span style=\"color: #66cc66;\">)<\/span>;\r\n  pinMode<span style=\"color: #66cc66;\">(<\/span>PA1, PWM<span style=\"color: #66cc66;\">)<\/span>;\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>brig<span style=\"color: #66cc66;\">&gt;<\/span><span style=\"color: #cc66cc;\">4<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>brig=<span style=\"color: #cc66cc;\">4<\/span>;<span style=\"color: #66cc66;\">}<\/span>tm.<span style=\"color: #006600;\">brig<\/span><span style=\"color: #66cc66;\">(<\/span>brig<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>alarm=<span style=\"color: #cc66cc;\">0<\/span>;\r\n<span style=\"color: #808080; font-style: italic;\">\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ \u0432\u044b\u0432\u043e\u0434 \u0432\u0440\u0435\u043c\u0435\u043d\u0438  <\/span>\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>digitalRead<span style=\"color: #66cc66;\">(<\/span>PB5<span style=\"color: #66cc66;\">)<\/span>==LOW<span style=\"color: #66cc66;\">&amp;&amp;<\/span>alarm==<span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">&amp;&amp;<\/span>digitalRead<span style=\"color: #66cc66;\">(<\/span>PA7<span style=\"color: #66cc66;\">)<\/span>==LOW<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>\r\n   hh=rtc.<span style=\"color: #006600;\">hour<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;mm=rtc.<span style=\"color: #006600;\">minute<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n   rtc.<span style=\"color: #006600;\">refresh<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #808080; font-style: italic;\">\/\/ \u043e\u043f\u0440\u043e\u0441 \u0432\u0440\u0435\u043c\u0435\u043d\u0438<\/span>\r\n   h = rtc.<span style=\"color: #006600;\">hour<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">*<\/span><span style=\"color: #cc66cc;\">100<\/span> + rtc.<span style=\"color: #006600;\">minute<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;tm.<span style=\"color: #006600;\">print_time<\/span><span style=\"color: #66cc66;\">(<\/span>h, <span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">)<\/span>;delay<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">500<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n   tm.<span style=\"color: #006600;\">print_time<\/span><span style=\"color: #66cc66;\">(<\/span>h, <span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">)<\/span>;delay<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">500<\/span><span style=\"color: #66cc66;\">)<\/span>;i++;\r\n<span style=\"color: #808080; font-style: italic;\">\/\/if(i==10){i=0;tm.print_float(rtc.temp()\/100,0 ,0b1111000,0,0,0);delay(2000);}\/\/ \u0432\u044b\u0432\u043e\u0434 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b DS3231 (t 27)<\/span>\r\n<span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>i==<span style=\"color: #cc66cc;\">10<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>i=<span style=\"color: #cc66cc;\">0<\/span>;tm.<span style=\"color: #006600;\">print_float<\/span><span style=\"color: #66cc66;\">(<\/span>rtc.<span style=\"color: #006600;\">temp<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>,<span style=\"color: #cc66cc;\">0<\/span> ,<span style=\"color: #cc66cc;\">0<\/span>,<span style=\"color: #cc66cc;\">0<\/span>,0b01100011,0b00111001<span style=\"color: #66cc66;\">)<\/span>;delay<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">2000<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span><span style=\"color: #808080; font-style: italic;\">\/\/ \u0432\u044b\u0432\u043e\u0434 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b DS3231 (27*C)<\/span>\r\n  <span style=\"color: #66cc66;\">}<\/span>\r\n<span style=\"color: #808080; font-style: italic;\">\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ \u043a\u043e\u0440\u0440\u0435\u043a\u0446\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438 - \u0447\u0430\u0441\u044b \u0438 \u043c\u0438\u043d\u0443\u0442\u044b<\/span>\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>digitalRead<span style=\"color: #66cc66;\">(<\/span>PB5<span style=\"color: #66cc66;\">)<\/span>==HIGH<span style=\"color: #66cc66;\">&amp;&amp;<\/span>digitalRead<span style=\"color: #66cc66;\">(<\/span>PB10<span style=\"color: #66cc66;\">)<\/span>==HIGH<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>w=<span style=\"color: #cc66cc;\">1<\/span>;hh++;<span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>hh<span style=\"color: #66cc66;\">&gt;<\/span><span style=\"color: #cc66cc;\">23<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>hh=<span style=\"color: #cc66cc;\">0<\/span>;<span style=\"color: #66cc66;\">}<\/span>delay<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">300<\/span><span style=\"color: #66cc66;\">)<\/span>;tm.<span style=\"color: #006600;\">print_time<\/span><span style=\"color: #66cc66;\">(<\/span>hh<span style=\"color: #66cc66;\">*<\/span><span style=\"color: #cc66cc;\">100<\/span>+mm, <span style=\"color: #cc66cc;\">1<\/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>PB5<span style=\"color: #66cc66;\">)<\/span>==HIGH<span style=\"color: #66cc66;\">&amp;&amp;<\/span>digitalRead<span style=\"color: #66cc66;\">(<\/span>PB11<span style=\"color: #66cc66;\">)<\/span>==HIGH<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>w=<span style=\"color: #cc66cc;\">1<\/span>;mm++;<span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>mm<span style=\"color: #66cc66;\">&gt;<\/span><span style=\"color: #cc66cc;\">59<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>mm=<span style=\"color: #cc66cc;\">0<\/span>;<span style=\"color: #66cc66;\">}<\/span>delay<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">300<\/span><span style=\"color: #66cc66;\">)<\/span>;tm.<span style=\"color: #006600;\">print_time<\/span><span style=\"color: #66cc66;\">(<\/span>hh<span style=\"color: #66cc66;\">*<\/span><span style=\"color: #cc66cc;\">100<\/span>+mm, <span style=\"color: #cc66cc;\">1<\/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>PB5<span style=\"color: #66cc66;\">)<\/span>==HIGH<span style=\"color: #66cc66;\">&amp;&amp;<\/span>digitalRead<span style=\"color: #66cc66;\">(<\/span>PB10<span style=\"color: #66cc66;\">)<\/span>==LOW<span style=\"color: #66cc66;\">&amp;&amp;<\/span>digitalRead<span style=\"color: #66cc66;\">(<\/span>PB11<span style=\"color: #66cc66;\">)<\/span>==LOW<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>rtc.<span style=\"color: #0066cc;\">set<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">0<\/span>, mm, hh, -<span style=\"color: #cc66cc;\">1<\/span>, -<span style=\"color: #cc66cc;\">1<\/span>, -<span style=\"color: #cc66cc;\">1<\/span>, -<span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span>\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>w=<span style=\"color: #cc66cc;\">0<\/span>;rtc.<span style=\"color: #0066cc;\">set<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">0<\/span>, mm, hh, -<span style=\"color: #cc66cc;\">1<\/span>, -<span style=\"color: #cc66cc;\">1<\/span>, -<span style=\"color: #cc66cc;\">1<\/span>, -<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;\">\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ \u044f\u0440\u043a\u043e\u0441\u0442\u044c \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u0430  <\/span>\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>digitalRead<span style=\"color: #66cc66;\">(<\/span>PB10<span style=\"color: #66cc66;\">)<\/span>==HIGH<span style=\"color: #66cc66;\">&amp;&amp;<\/span>digitalRead<span style=\"color: #66cc66;\">(<\/span>PA7<span style=\"color: #66cc66;\">)<\/span>==LOW<span style=\"color: #66cc66;\">&amp;&amp;<\/span>digitalRead<span style=\"color: #66cc66;\">(<\/span>PB5<span style=\"color: #66cc66;\">)<\/span>==LOW<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>brig++;<span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>brig<span style=\"color: #66cc66;\">&gt;<\/span><span style=\"color: #cc66cc;\">4<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>brig=<span style=\"color: #cc66cc;\">4<\/span>;<span style=\"color: #66cc66;\">}<\/span>tm.<span style=\"color: #006600;\">brig<\/span><span style=\"color: #66cc66;\">(<\/span>brig<span style=\"color: #66cc66;\">)<\/span>;EEPROM.<span style=\"color: #006600;\">update<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">10<\/span>, brig<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>PB11<span style=\"color: #66cc66;\">)<\/span>==HIGH<span style=\"color: #66cc66;\">&amp;&amp;<\/span>digitalRead<span style=\"color: #66cc66;\">(<\/span>PA7<span style=\"color: #66cc66;\">)<\/span>==LOW<span style=\"color: #66cc66;\">&amp;&amp;<\/span>digitalRead<span style=\"color: #66cc66;\">(<\/span>PB5<span style=\"color: #66cc66;\">)<\/span>==LOW<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>brig--;<span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>brig<span style=\"color: #66cc66;\">&lt;<\/span><span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>brig=<span style=\"color: #cc66cc;\">0<\/span>;<span style=\"color: #66cc66;\">}<\/span>tm.<span style=\"color: #006600;\">brig<\/span><span style=\"color: #66cc66;\">(<\/span>brig<span style=\"color: #66cc66;\">)<\/span>;EEPROM.<span style=\"color: #006600;\">update<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">10<\/span>, brig<span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span>\r\n<span style=\"color: #808080; font-style: italic;\">\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ \u0431\u0443\u0434\u0438\u043b\u044c\u043d\u0438\u043a<\/span>\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>digitalRead<span style=\"color: #66cc66;\">(<\/span>PA7<span style=\"color: #66cc66;\">)<\/span>==HIGH<span style=\"color: #66cc66;\">&amp;&amp;<\/span>digitalRead<span style=\"color: #66cc66;\">(<\/span>PB10<span style=\"color: #66cc66;\">)<\/span>==HIGH<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>w1=<span style=\"color: #cc66cc;\">0<\/span>;al_hh++;<span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>al_hh<span style=\"color: #66cc66;\">&gt;<\/span><span style=\"color: #cc66cc;\">23<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>al_hh=<span style=\"color: #cc66cc;\">0<\/span>;<span style=\"color: #66cc66;\">}<\/span>delay<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">300<\/span><span style=\"color: #66cc66;\">)<\/span>;EEPROM.<span style=\"color: #006600;\">update<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">11<\/span>, al_hh<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>PA7<span style=\"color: #66cc66;\">)<\/span>==HIGH<span style=\"color: #66cc66;\">&amp;&amp;<\/span>digitalRead<span style=\"color: #66cc66;\">(<\/span>PB11<span style=\"color: #66cc66;\">)<\/span>==HIGH<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>w1=<span style=\"color: #cc66cc;\">0<\/span>;al_mm++;<span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>al_mm<span style=\"color: #66cc66;\">&gt;<\/span><span style=\"color: #cc66cc;\">59<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>al_mm=<span style=\"color: #cc66cc;\">0<\/span>;<span style=\"color: #66cc66;\">}<\/span>delay<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">300<\/span><span style=\"color: #66cc66;\">)<\/span>;EEPROM.<span style=\"color: #006600;\">update<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">12<\/span>, al_mm<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>PA7<span style=\"color: #66cc66;\">)<\/span>==HIGH<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>tm.<span style=\"color: #006600;\">print_time<\/span><span style=\"color: #66cc66;\">(<\/span>al_hh<span style=\"color: #66cc66;\">*<\/span><span style=\"color: #cc66cc;\">100<\/span>+al_mm, <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>hh<span style=\"color: #66cc66;\">*<\/span><span style=\"color: #cc66cc;\">100<\/span>+mm==al_hh<span style=\"color: #66cc66;\">*<\/span><span style=\"color: #cc66cc;\">100<\/span>+al_mm<span style=\"color: #66cc66;\">&amp;&amp;<\/span>w1==<span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>alarm=<span style=\"color: #cc66cc;\">1<\/span>;<span style=\"color: #66cc66;\">}<\/span><span style=\"color: #b1b100;\">else<\/span><span style=\"color: #66cc66;\">{<\/span>alarm=<span style=\"color: #cc66cc;\">0<\/span>;<span style=\"color: #66cc66;\">}<\/span>\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>alarm==<span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">&amp;&amp;<\/span><span style=\"color: #66cc66;\">(<\/span>digitalRead<span style=\"color: #66cc66;\">(<\/span>PA7<span style=\"color: #66cc66;\">)<\/span>==HIGH<span style=\"color: #66cc66;\">||<\/span>digitalRead<span style=\"color: #66cc66;\">(<\/span>PB5<span style=\"color: #66cc66;\">)<\/span>==HIGH<span style=\"color: #66cc66;\">||<\/span>digitalRead<span style=\"color: #66cc66;\">(<\/span>PB10<span style=\"color: #66cc66;\">)<\/span>==HIGH<span style=\"color: #66cc66;\">||<\/span>digitalRead<span style=\"color: #66cc66;\">(<\/span>PB11<span style=\"color: #66cc66;\">)<\/span>==HIGH<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>alarm=<span style=\"color: #cc66cc;\">0<\/span>;w1=<span style=\"color: #cc66cc;\">1<\/span>;<span style=\"color: #66cc66;\">}<\/span>\r\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #66cc66;\">(<\/span>alarm==<span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>pwmWrite<span style=\"color: #66cc66;\">(<\/span>PA1,<span style=\"color: #cc66cc;\">35000<\/span><span style=\"color: #66cc66;\">)<\/span>;delay<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">200<\/span><span style=\"color: #66cc66;\">)<\/span>;pwmWrite<span style=\"color: #66cc66;\">(<\/span>PA1,<span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">)<\/span>;delay<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">100<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span><span style=\"color: #b1b100;\">else<\/span><span style=\"color: #66cc66;\">{<\/span>pwmWrite<span style=\"color: #66cc66;\">(<\/span>PA1,<span style=\"color: #cc66cc;\">0<\/span><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","protected":false},"excerpt":{"rendered":"<p>\u041d\u0430 \u0431\u0430\u0437\u0435 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u044b STM32 (\u0431\u0430\u0437\u0435 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 STM32F103C8T6) \u0438 \u0441\u0435\u043c\u0438\u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043d\u043e\u043c \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u043c \u0434\u0438\u0441\u043f\u043b\u0435\u0435 TM1637 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0447\u0430\u0441\u044b \u0441 \u0431\u0443\u0434\u0438\u043b\u044c\u043d\u0438\u043a\u043e\u043c. \u0412 \u0443\u0441\u0442-\u0432\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0447\u0430\u0441\u044b \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 DS3231 (DS1307). \u0427\u0430\u0441\u044b \u0441 \u0431\u0443\u0434\u0438\u043b\u044c\u043d\u0438\u043a\u043e\u043c \u0438\u043c\u0435\u044e\u0442 \u0447\u0435\u0442\u044b\u0440\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u044f, \u0432\u0440\u0435\u043c\u044f \u0431\u0443\u0434\u0438\u043b\u044c\u043d\u0438\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u044f\u0440\u043a\u043e\u0441\u0442\u044c \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u0430. \u042f\u0440\u043a\u043e\u0441\u0442\u044c \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0438 \u0432\u0440\u0435\u043c\u044f \u0431\u0443\u0434\u0438\u043b\u044c\u043d\u0438\u043a\u0430 \u0437\u0430\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u0432 \u044d\u043d\u0435\u0440\u0433\u043e\u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c. \u041f\u0440\u0438 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":76074,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[239,18],"tags":[],"class_list":["post-76072","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino","category-18"],"views":10484,"_links":{"self":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/76072","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=76072"}],"version-history":[{"count":9,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/76072\/revisions"}],"predecessor-version":[{"id":111266,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/76072\/revisions\/111266"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/media\/76074"}],"wp:attachment":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=76072"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=76072"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=76072"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}