{"id":300250,"date":"2020-03-17T09:00:32","date_gmt":"2020-03-17T09:00:32","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=300250"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=300250","title":{"rendered":"\u041a\u0430\u0440\u0442\u043e\u0447\u043d\u0430\u044f \u0438\u0433\u0440\u0430 \u00ab\u0414\u0443\u0440\u0430\u043a\u00bb \u043d\u0430 \u0434\u0432\u0443\u0445 M5Stack"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/492652\/\">\n<h2 id=\"cel-uroka\">\u0426\u0435\u043b\u044c \u0443\u0440\u043e\u043a\u0430<\/h2>\n<p>  <\/p>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u0435\u0442\u0435\u0432\u0443\u044e \u043a\u0430\u0440\u0442\u043e\u0447\u043d\u0443\u044e \u0438\u0433\u0440\u0443 \u043d\u0430 \u0434\u0432\u0443\u0445 \u0438\u0433\u0440\u043e\u043a\u043e\u0432. \u041a\u0430\u043a\u0443\u044e \u0438\u0433\u0440\u0443 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0443\u044e \u043a\u0430\u0440\u0442\u043e\u0447\u043d\u0443\u044e \u0438\u0433\u0440\u0443 &quot;\u0414\u0443\u0440\u0430\u043a&quot;, \u0446\u0435\u043b\u044c \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u2014 \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u0432\u0441\u0435\u0445 \u043a\u0430\u0440\u0442. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u0445 \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u0437\u0434\u0435\u0441\u044c:<br \/>  <a href=\"https:\/\/en.wikipedia.org\/wiki\/Durak\" rel=\"nofollow\">https:\/\/en.wikipedia.org\/wiki\/Durak<\/a><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/2bc\/4b7\/69d\/2bc4b769db51d266ee7fc7d18e88c475.jpg\"><\/p>\n<p>  <\/p>\n<p>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 1.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"nemnogo-teorii\">\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0442\u0435\u043e\u0440\u0438\u0438<\/h2>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0440\u0442 \u2014 \u0441\u043b\u0435\u043d\u0433\u043e\u0432\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 RS-232, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u0430\u0441\u0441\u043e\u0432\u043e \u043e\u0441\u043d\u0430\u0449\u0430\u043b\u0438\u0441\u044c \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u044b, \u0442\u0435\u0445\u043d\u0438\u043a\u0430 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u043f\u0440\u0438\u043d\u0442\u0435\u0440\u044b. \u041f\u043e\u0440\u0442 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f &quot;\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c&quot;, \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0431\u0438\u0442\u0443, \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u0438\u0442 \u0437\u0430 \u0431\u0438\u0442\u043e\u043c. \u041e\u0431\u044b\u0447\u043d\u044b\u0435 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u044b \u0441\u043d\u0430\u0431\u0436\u0435\u043d\u044b RS-232, \u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b \u0438 M5STACK \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 TTL.<br \/>  RS-232 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 &quot;0&quot; \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u043e\u0442 -3 \u0434\u043e -25 \u0412, \u0430 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 &quot;1&quot; \u043e\u0442 +3 \u0434\u043e +25 \u0412. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0438 \u043e\u0442 RS-232 \u0432 TTL \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 &quot;0&quot; \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u0431\u043b\u0438\u0437\u043a\u043e\u0435 \u043a 0 \u0412, \u0430 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 &quot;1&quot; \u0440\u0430\u0431\u043e\u0447\u0435\u0435 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0445\u0435\u043c\u044b, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e 3.3 \u0438\u043b\u0438 5 \u0412 (\u0440\u0438\u0441. 2).<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/3a1\/bb0\/0e0\/3a1bb00e0b2c1087d74753548862a293.jpg\"><\/p>\n<p>  <\/p>\n<p>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 2. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0439 \u043c\u0435\u0436\u0434\u0443 RS-232 \u0438 TTL<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043e\u0431\u043c\u0435\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0440\u0442 M5STACK \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u0435 \u043f\u043e\u0440\u0442\u044b \u0432\u0432\u043e\u0434\/\u0432\u044b\u0432\u043e\u0434\u0430 R0, R2 (RX) \u0438 T0, T2 (TX) (\u0440\u0438\u0441. 3), \u0430 \u0442\u0430\u043a\u0436\u0435 USB \u043f\u043e\u0440\u0442. \u0412\u0430\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043f\u043e\u0440\u0442\u043e\u043c, \u0442\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0441 \u044d\u0442\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0440\u0442\u044b 0 \u0438 1 \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0446\u0435\u043b\u0435\u0439.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/b77\/313\/942\/b773139423c2f499729b4a8fb0676d7a.jpg\"><br \/>  \u0420\u0438\u0441\u0443\u043d\u043e\u043a 3. \u041f\u0440\u0430\u0432\u0438\u043b\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0440\u0442<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c \u043f\u043e\u0440\u0442\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 Serial \u0438\u0437 Arduino IDE <a href=\"https:\/\/www.arduino.cc\/reference\/en\/language\/functions\/communication\/serial\" rel=\"nofollow\">https:\/\/www.arduino.cc\/reference\/en\/language\/functions\/communication\/serial\/<\/a><\/p>\n<p>  <\/p>\n<p>\u041e\u0437\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c \u0441 \u043f\u043e\u043d\u044f\u0442\u0438\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u044b ASCII, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043a\u043e\u0434\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0432 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0442\u0435\u0445\u043d\u0438\u043a\u0435: <a href=\"https:\/\/en.wikipedia.org\/wiki\/ASCII\" rel=\"nofollow\">https:\/\/en.wikipedia.org\/wiki\/ASCII<\/a><\/p>\n<p>  <\/p>\n<p><strong>\u041f\u0435\u0440\u0435\u0447\u0435\u043d\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u0443\u0440\u043e\u043a\u0430<\/strong><\/p>\n<p>  <\/p>\n<ul>\n<li>M5STACK (2 \u0448\u0442.);<\/li>\n<li>\u043a\u0430\u0431\u0435\u043b\u044c USB-C \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 (2 \u0448\u0442.);<\/li>\n<li>\u0446\u0432\u0435\u0442\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u0430 \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430.<\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"nachnyom\">\u041d\u0430\u0447\u043d\u0451\u043c!<\/h2>\n<p>  <\/p>\n<h3 id=\"shag-1-pristupim-s-samogo-glavnogo---logotip\">\u0428\u0430\u0433 1. \u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u2014 \u043b\u043e\u0433\u043e\u0442\u0438\u043f<\/h3>\n<p>  <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0440\u0438\u0441\u0443\u0435\u043c \u043b\u043e\u0433\u043e\u0442\u0438\u043f \u0438\u0433\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043d\u0430 \u0434\u0438\u0441\u043f\u043b\u0435\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0438\u0433\u0440\u044b. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043b\u044e\u0431\u043e\u0439 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 MS Office Word \u0438 Paint (\u0440\u0438\u0441. 4). <\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/98e\/d89\/945\/98ed899458f0399d4c87143e4ed988c1.jpg\"><\/p>\n<p>  <\/p>\n<p>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 4. \u0420\u0438\u0441\u0443\u0435\u043c \u043b\u043e\u0433\u043e\u0442\u0438\u043f \u0438\u0433\u0440\u044b \u0432 MS Office Word \u0438 Paint \ud83d\ude42<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0437 \u0443\u0440\u043e\u043a\u0430 1.2.1 <a href=\"http:\/\/forum.m5stack.com\/topic\/49\/lesson-1-2-1-lcd-how-to-create-image-array\" title=\"http:\/\/forum.m5stack.com\/topic\/49\/lesson-1-2-1-lcd-how-to-create-image-array\" rel=\"nofollow\">http:\/\/forum.m5stack.com\/topic\/49\/lesson-1-2-1-lcd-how-to-create-image-array<\/a> \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0444\u0430\u0439\u043b logo.c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u043a \u0441\u043a\u0435\u0442\u0447\u0443.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">extern unsigned char logo[];<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"shag-2-sozdadim-strukturu-kolody-kart\">\u0428\u0430\u0433 2. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043a\u043e\u043b\u043e\u0434\u044b \u043a\u0430\u0440\u0442<\/h3>\n<p>  <\/p>\n<p>\u041f\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c \u0438\u0433\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u043b\u043e\u0434\u0430, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0430\u044f \u0442\u043e\u043b\u044c\u043a\u043e 36 \u043a\u0430\u0440\u0442. \u041f\u043e 6 \u043a\u0430\u0440\u0442 \u0432\u044b\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0438\u0433\u0440\u043e\u043a\u0443. \u0418\u0433\u0440\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u043e \u043d\u0430 12 \u043a\u0430\u0440\u0442. \u0418\u0433\u0440\u043e\u043a \u043c\u043e\u0436\u0435\u0442 \u0432\u0437\u044f\u0442\u044c 10 \u043a\u0430\u0440\u0442, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0438\u0433\u0440\u0430\u0435\u0442. \u0412 \u0438\u0433\u0440\u0435 \u043a\u0430\u0440\u0442\u0430 \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0451 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438 \u043c\u0430\u0441\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 7. \u0412 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u043a\u0430\u0440\u0442\u0430 \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0451 \u043c\u0435\u0441\u0442\u043e: (\u0432 \u0440\u0443\u043a\u0430\u0445 \u0443 \u0438\u0433\u0440\u043e\u043a\u0430 \u2014 \u043f\u043e\u043b\u0435 \u0438\u0433\u0440\u043e\u043a\u0430; \u0432 \u0438\u0433\u0440\u043e\u0432\u043e\u043c \u043f\u043e\u043b\u0435; \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043a\u043e\u043b\u043e\u0434\u0435; \u0432 \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043a\u043e\u043b\u043e\u0434\u0435) \u0438 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435: \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u0430\u044f \u043a\u0430\u0440\u0442\u0430, \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430\u044f \u043a\u0430\u0440\u0442\u0430, \u043a\u0430\u0440\u0442\u0430 \u043a\u043e\u0437\u044b\u0440\u043d\u0430\u044f, \u043a\u0430\u0440\u0442\u0430 \u0438\u0433\u0440\u043e\u043a\u0430, \u043a\u0430\u0440\u0442\u0430 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u0430. \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u0432\u044b\u0435 \u043d\u043e\u043c\u0435\u0440\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u041a\u043e\u043b\u043e\u0434\u0430 \u043a\u0430\u0440\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 (\u0440\u0438\u0441. 5).<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/2e2\/fde\/a75\/2e2fdea75bf704448561501b453dc46b.jpg\"><\/p>\n<p>  <\/p>\n<p>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 5. \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043a\u0430\u0440\u0442\u044b \u0438 \u043c\u0430\u0441\u0441\u0438\u0432 \u043a\u043e\u043b\u043e\u0434\u044b \u043a\u0430\u0440\u0442<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">#define playerAmount 6 #define fullAmount 36 #define playerFieldAmount 10 #define gameFieldAmount 6  struct playCard {   int card;   int suit;   int color;   int property = -1; \/\/ -2 not avaiable, -1 free, 0 trump, 1 player #1, 2 player #2   int field; \/\/ + player field, - game field };  String cards[9] = {&quot;6&quot;, &quot;7&quot;, &quot;8&quot;, &quot;9&quot;, &quot;10&quot;, &quot;J&quot;, &quot;Q&quot;, &quot;K&quot;, &quot;A&quot;}; char suits[4] = {3, 4, 5, 6}; \/\/ , , ,  int colors[2] = {0xe8e4, 0x00}; \/\/ red, black playCard deckCards[fullAmount];<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"shag-3-napishem-pravila-igry\">\u0428\u0430\u0433 3. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438\u0433\u0440\u044b<\/h3>\n<p>  <\/p>\n<p>\u0410\u0442\u0430\u043a\u0430. \u0421\u043b\u0443\u0447\u0430\u0439 1. \u0415\u0441\u043b\u0438 \u0432 \u0438\u0433\u0440\u043e\u0432\u043e\u043c \u043f\u043e\u043b\u0435 \u043d\u0435\u0442 \u043d\u0438 \u043e\u0434\u043d\u043e\u0439 \u043a\u0430\u0440\u0442\u044b, \u0442\u043e\u0433\u0434\u0430 \u0438\u0433\u0440\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u043f\u0435\u0440\u0432\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u043c\u043e\u0436\u0435\u0442 \u043a\u0438\u043d\u0443\u0442\u044c \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043b\u044e\u0431\u0443\u044e \u043a\u0430\u0440\u0442\u0443 \u043b\u044e\u0431\u043e\u0439 \u043c\u0430\u0441\u0442\u0438 (\u0440\u0438\u0441. 5.1):<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/55d\/c35\/a41\/55dc35a41f735f84335beda800aca546.jpg\"><\/p>\n<p>  <\/p>\n<p>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 5.1. \u041c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0445\u043e\u0434 \u043b\u044e\u0431\u043e\u0439 \u043a\u0430\u0440\u0442\u043e\u0439<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">if ((opponentSteps == playerSteps) &amp;&amp; (playerSteps == 0)) {   deckCards[selectedCard].field = -1;   sync(); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410\u0442\u0430\u043a\u0430. \u0421\u043b\u0443\u0447\u0430\u0439 2. \u0415\u0441\u043b\u0438 \u0441\u043e\u043f\u0435\u0440\u043d\u0438\u043a \u0441\u0434\u0435\u043b\u0430\u043b \u0445\u043e\u0434 \u043d\u0430 \u0438\u0433\u0440\u043e\u043a\u0430, \u0442\u043e \u0438\u0433\u0440\u043e\u043a \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u0431\u0438\u0442\u044c\u0441\u044f \u043a\u0430\u0440\u0442\u043e\u0439 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u043c\u0430\u0441\u0442\u0438, \u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (\u0440\u0438\u0441. 5.2) \u0438\u043b\u0438 \u043a\u043e\u0437\u044b\u0440\u043d\u043e\u0439 \u043a\u0430\u0440\u0442\u043e\u0439 \u043b\u044e\u0431\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u043a\u0430\u0440\u0442\u0430 \u0441\u043e\u043f\u0435\u0440\u043d\u0438\u043a\u0430 \u0432 \u0438\u0433\u0440\u043e\u0432\u043e\u043c \u043f\u043e\u043b\u0435 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u0437\u044b\u0440\u043d\u043e\u0439:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/d33\/dc8\/b4f\/d33dc8b4f3ea7163fa37cd16ccf1a232.jpg\"><\/p>\n<p>  <\/p>\n<p>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 5.1. \u0421\u043e\u043f\u0435\u0440\u043d\u0438\u043a \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u0442\u0431\u0438\u0442\u044c \u043a\u0430\u0440\u0442\u0443 \u0438\u0433\u0440\u043e\u043a\u0430<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">else if (opponentSteps &gt; playerSteps) {   if ((((deckCards[selectedCard].card &gt; deckCards[pfCardId].card) &amp;&amp; (deckCards[selectedCard].suit == deckCards[pfCardId].suit)) || ((deckCards[selectedCard].suit == trumpSuit) &amp;&amp; (deckCards[pfCardId].suit != trumpSuit))))   {     deckCards[selectedCard].field = -opponentSteps;     sync();   } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410\u0442\u0430\u043a\u0430. \u0421\u043b\u0443\u0447\u0430\u0439 3. \u041a\u043e\u0433\u0434\u0430 \u0441\u043e\u043f\u0435\u0440\u043d\u0438\u043a \u043e\u0442\u043e\u0431\u044c\u0451\u0442 \u043a\u0430\u0440\u0442\u0443, \u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0448\u0430\u0433\u043e\u0432 \u0441\u0442\u0430\u043d\u0435\u0442 \u0440\u0430\u0432\u043d\u044b\u043c \u0438 \u0438\u0433\u0440\u043e\u043a \u0441\u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0434\u043a\u0438\u043d\u0443\u0442\u044c \u0435\u0449\u0451 \u043a\u0430\u0440\u0442\u044b \u0442\u0430\u043a\u043e\u0433\u043e \u0436\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0432 \u0438\u0433\u0440\u043e\u0432\u043e\u043c \u043f\u043e\u043b\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">else if (opponentSteps == playerSteps) {   for (int i = 0; i &lt; fullAmount; i++)   {     if ((deckCards[selectedCard].card == deckCards[i].card) &amp;&amp; (deckCards[i].field &lt; 0) &amp;&amp; (deckCards[i].property != -2))     {       deckCards[selectedCard].field = -(playerSteps + 1);       sync();       break;     }   } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0411\u0438\u0442\u043e\/\u0432\u0437\u044f\u0442\u044c. \u0421\u043b\u0443\u0447\u0430\u0439 1. \u0415\u0441\u043b\u0438 \u0443 \u0438\u0433\u0440\u043e\u043a\u043e\u0432 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0448\u0430\u0433\u043e\u0432, \u0442\u043e \u0438\u0433\u0440\u043e\u043a \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u0440\u0442\u044b \u0432 \u043e\u0442\u0431\u0438\u0442\u0443\u044e \u043a\u043e\u043b\u043e\u0434\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">if (opponentSteps == playerSteps) \/\/ \u0431\u0438\u0442\u043e {     for (int i = 0; i &lt; fullAmount; i++)     {         if (deckCards[i].field &lt; 0)         {             deckCards[i].property = -2;         }     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0411\u0438\u0442\u043e\/\u0432\u0437\u044f\u0442\u044c. \u0421\u043b\u0443\u0447\u0430\u0439 2. \u0415\u0441\u043b\u0438 \u0443 \u0441\u043e\u043f\u0435\u0440\u043d\u0438\u043a \u0441\u0434\u0435\u043b\u0430\u043b \u0431\u043e\u043b\u044c\u0448\u0435 \u0445\u043e\u0434\u043e\u0432, \u0447\u0435\u043c \u0438\u0433\u0440\u043e\u043a, \u0442\u043e \u0438\u0433\u0440\u043e\u043a \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u0435 \u043a\u0430\u0440\u0442\u044b \u0441 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u0441\u0435\u0431\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">else if (opponentSteps &gt; playerSteps) \/\/ \u0437\u0430\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u0435 \u043a\u0430\u0440\u0442\u044b \u0441\u0435\u0431\u0435 {     for (int i = 0; i &lt; fullAmount; i++)     {         if ((deckCards[i].field &lt; 0) &amp;&amp; (deckCards[i].property != -2))         {             addPlayerCard(playerId, i);         }     } }<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"shag-4-narisuem-karty\">\u0428\u0430\u0433 4. \u041d\u0430\u0440\u0438\u0441\u0443\u0435\u043c \u043a\u0430\u0440\u0442\u044b<\/h3>\n<p>  <\/p>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c \u0434\u0438\u0441\u043f\u043b\u0435\u0435\u043c \u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 M5STACK, \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u0440\u0442 \u0437\u0430\u0439\u043c\u0435\u0442 \u0434\u043e\u043b\u0438 \u0441\u0435\u043a\u0443\u043d\u0434 \u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u0437\u0430\u0439\u043c\u0451\u0442 \u043f\u0430\u043c\u044f\u0442\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">void drawCard(int x, int y, playCard card) {     M5.Lcd.fillRoundRect(x, y, 30, 50, 5, 0xffff);     M5.Lcd.drawRoundRect(x, y, 30, 50, 5, 0x00);     M5.Lcd.setTextSize(2);     M5.Lcd.setTextColor(colors[card.color]);     M5.Lcd.setCursor((x + 3), (y + 6));     M5.Lcd.print(cards[card.card]);     M5.Lcd.setTextSize(3);     M5.Lcd.setCursor((x + 8), (y + 24));     M5.Lcd.print(suits[card.suit]); }  void drawEmptyCard(int x, int y) {   M5.Lcd.fillRect(x, y, 30, 50, 0x2589);   M5.Lcd.drawRoundRect(x, y, 30, 50, 5, 0x00); }<\/code><\/pre>\n<p>  <\/p>\n<blockquote><p>\u041b\u0430\u0439\u0444\u0445\u0430\u043a \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 Windows: \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0437\u0430\u0439\u0442\u0438 \u0432 \u043b\u044e\u0431\u043e\u0439 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0438 \u0437\u0430\u0436\u0430\u0442\u044c \u043d\u0430 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u0435 \u043a\u043b\u0430\u0432\u0438\u0448\u0443 Alt \u0438 \u043d\u0430\u0431\u0440\u0430\u0442\u044c \u043e\u0434\u043d\u0443 \u0438\u0437 \u0446\u0438\u0444\u0440 \u043e\u0442 3 \u0434\u043e 6, \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0430\u0436\u0430\u0442\u044b\u0435 \u043a\u043b\u0430\u0432\u0438\u0448\u0438.<\/p><\/blockquote>\n<p>  <\/p>\n<h3 id=\"shag-5-napishem-animaciyu-dvizheniya-kart\">\u0428\u0430\u0433 5. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u043a\u0430\u0440\u0442<\/h3>\n<p>  <\/p>\n<pre><code class=\"plaintext\">void drawSelect(playCard card) {     int n = card.field - 1;     int x = 10 + (n * 30);     int y = (yPlayerField - 10);     drawEmptyCard(x, yPlayerField);     drawCard(x, y, card); }  void clearSelect(playCard card) {     int n = card.field - 1;     int x = 10 + (n * 30);     int y = (yPlayerField - 10);     M5.Lcd.fillRect(x, y, 30, 50, 0x2589);     drawCard(x, yPlayerField, card); }<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"shag-6-narisuem-igrovoy-stol-i-menyu\">\u0428\u0430\u0433 6. \u041d\u0430\u0440\u0438\u0441\u0443\u0435\u043c \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u0441\u0442\u043e\u043b \u0438 \u043c\u0435\u043d\u044e<\/h3>\n<p>  <\/p>\n<pre><code class=\"plaintext\">void drawGameTable() {     M5.Lcd.fillScreen(0x2589); \/\/ green table     drawAllFields(); }  void drawMenu() {     M5.Lcd.fillRect(0, 0, 320, 20, 0x00); \/\/ score bar     M5.Lcd.fillRect(0, 220, 320, 20, 0x00); \/\/ menu bar     \/* menu buttons *\/     M5.Lcd.setTextSize(2);     M5.Lcd.setTextColor(0x7bef);     M5.Lcd.setCursor(62, 223);     M5.Lcd.print(&quot;G&quot;);     M5.Lcd.setCursor(155, 223);     M5.Lcd.print(&quot;A&quot;);     M5.Lcd.setCursor(247, 223);     M5.Lcd.print(&quot;S&quot;); }<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"shag-7-obnovlenie-grafiki\">\u0428\u0430\u0433 7. \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0433\u0440\u0430\u0444\u0438\u043a\u0438<\/h3>\n<p>  <\/p>\n<pre><code class=\"plaintext\">void updateGraphics() {     drawGameTable();     drawMenu();     drawPlayerId();     drawRest();     for (int i = 0; i &lt; fullAmount; i++)     {         if (deckCards[i].property == playerId)         {             if (deckCards[i].field &gt; 0) \/\/ if in the hands of                 drawPlayerCard(deckCards[i]);              else \/\/ if in the playing field                 drawPlPfCard(deckCards[i]);          }         else if (deckCards[i].property == getOpponentId())         {             if (deckCards[i].field &lt; 0)                 drawOpPfCard(deckCards[i]); \/\/ draw opponent's cards in the playing field         }         else if (deckCards[i].property == 0)         {             drawTrumpCard(deckCards[i]);         }     } }<\/code><\/pre>\n<p>  <\/p>\n<blockquote><p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, drawPlayerId()) \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u043f\u043e\u043b\u043d\u043e\u043c \u0441\u043a\u0435\u0442\u0447\u0435 \u0438\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043b\u0443\u0447\u0448\u0435 \ud83d\ude09<\/p><\/blockquote>\n<p>  <\/p>\n<h3 id=\"shag-8-napishem-funkcii-dlya-priyomaotpravki-dannyh-cherez-posledovatelnyy-port\">\u0428\u0430\u0433 8. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043f\u0440\u0438\u0451\u043c\u0430\/\u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0440\u0442<\/h3>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/a7c\/649\/ff0\/a7c649ff0fe2f3e5f0763730982292cb.jpg\"><\/p>\n<p>  <\/p>\n<p>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 5.3<\/p>\n<p>  <\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 \u043a\u043e\u043d\u0435\u0446 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0441\u0438\u043c\u0432\u043e\u043b \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u0451 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0440\u0442. \u041f\u043e\u0442\u043e\u043c \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0443\u044e \u0432 \u0441\u0435\u0431\u0435 \u0441\u0438\u043c\u0432\u043e\u043b \u043a\u043e\u043d\u0446\u0430 \u0441\u0435\u0430\u043d\u0441\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u0415\u0441\u043b\u0438 \u0441\u0438\u043c\u0432\u043e\u043b \u043f\u0440\u0438\u0448\u0451\u043b, \u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u0435\u0440\u043d\u0451\u0442 true \u0438\u043d\u0430\u0447\u0435 false.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">bool serialWriteStr(String str) {     Serial.print(str);     Serial.print('\\n');     String input = serialReadStr();      if (input != &quot;&quot;)     {         if (input[0] == (char)0x04) return true;     }     return false; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u0451\u043c\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0438 timeout (3000 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434) \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0447\u0438\u0449\u0430\u044f \u043e\u0442 \u043c\u0443\u0441\u043e\u0440\u0430 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0434\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0430\u043a\u0435\u0442\u0430. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u0443\u0434\u0430\u0447\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0443\u0441\u0442\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">String serialReadStr() {     String buf = &quot;&quot;;     long timeout = 3000;     long previousMillis = millis();     while (true)     {         unsigned long currentMillis = millis();         if (currentMillis - previousMillis &gt; timeout) break;         if (Serial.available() &gt; 0)         {             char chr = (char)Serial.read();             if ((chr != (char)0x16) &amp;&amp; (chr != (char)0x04) &amp;&amp; (buf == &quot;&quot;)) \/\/ clear trash             {                 Serial.read();             }             else             {                 if (chr == '\\n')                     break;                 else                     buf += chr;             }           }     }        if (buf != &quot;&quot;)     {         Serial.print((char)0x04);         Serial.print('\\n');     }     return buf; }<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"shag-9-sdelaem-obrabotku-vhodyaschih-paketov-dannyh\">\u0428\u0430\u0433 9. \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>  <\/p>\n<p>\u0421\u0434\u0435\u043b\u0430\u0435\u043c \u0442\u0430\u043a, \u0447\u0442\u043e \u043b\u044e\u0431\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u0430\u044f \u043c\u0435\u0436\u0434\u0443 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u0443\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u043b\u0430\u0441\u044c \u0432 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b (\u0440\u0438\u0441. 6). \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442, \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043f\u0430\u043a\u0435\u0442\u044b. \u0410 \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e (parseString), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438, \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0436\u0434\u0443 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u043a\u043e\u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0435\u0439 (\u043f\u043e\u0445\u043e\u0436\u0430 \u043d\u0430 \u043c\u0435\u0442\u043e\u0434 Split \u0438\u0437 JS).<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/740\/0d6\/2be\/7400d62be0141c77b05d266cd1813413.jpg\"><\/p>\n<p>  <\/p>\n<p>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 6. \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0430\u043a\u0435\u0442\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">bool serialRecivePacket() {     String input = serialReadStr();      if (input.length() &gt; 0)     {         if ((char)input[0] == (char)0x16)          {             input[0] = ' ';             char groupType = ((parseString(0, (char)0x1d, input)).toInt()) + '0';             String groupData = parseString(1, (char)0x1d, input);             int groupDataLenmo = (groupData.length() - 1);             if (groupData[groupDataLenmo] == (char)0x03)               {                 groupData[groupDataLenmo] = ' ';                  if (groupType == (char)0x31) updateReciveDeckCards(groupData);                  else if (groupType == (char)0x32) playerId = 2;                  return true;             }         }     return false;     } }  String parseString(int idSeparator, char separator, String str) { \/\/ like split JS     String output = &quot;&quot;;     int separatorCout = 0;     for (int i = 0; i &lt; str.length(); i++)     {         if ((char)str[i] == separator)         {             separatorCout++;         }         else         {             if (separatorCout == idSeparator)         {             output += (char)str[i];         }         else if (separatorCout &gt; idSeparator)         {             break;         }     }     return output; }<\/code><\/pre>\n<p>  <\/p>\n<blockquote><p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 parseString:  <\/p>\n<blockquote><p>parseString(1, &#8216;:&#8217;, &quot;cat:Bob,Jack:dog:Martin,Kelvin&quot;); &#8212;&#8212;&gt; Bob,Jack<\/p>\n<p>  parseString(0, &#8216;,&#8217;, &quot;Bob,Jack&quot;); &#8212;&#8212;&gt; Bob<\/p>\n<p>  parseString(1, &#8216;,&#8217;, &quot;Bob,Jack&quot;); &#8212;&#8212;&gt; Jack<\/p><\/blockquote>\n<p>  <\/p><\/blockquote>\n<p>  <\/p>\n<h3 id=\"shag-10-realizuem-sistemu-zadayuschuyu-nomer-igroka\">\u0428\u0430\u0433 10. \u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0437\u0430\u0434\u0430\u044e\u0449\u0443\u044e \u043d\u043e\u043c\u0435\u0440 \u0438\u0433\u0440\u043e\u043a\u0430<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0438 \u043a\u0430\u0431\u0435\u043b\u044f, \u043a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0432\u044b\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0448\u0430\u0435\u0442 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u044b, \u0438, \u043e\u0442\u0441\u044b\u043b\u0430\u0435\u0442 \u043f\u0430\u043a\u0435\u0442 &quot;\u042f \u0437\u0434\u0435\u0441\u044c!&quot; (\u0440\u0438\u0441. 7). \u041f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u0431\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0435\u0440\u0432\u044b\u043c\u0438 \u0438\u0433\u0440\u043e\u043a\u0430\u043c\u0438. \u0422\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0435\u0440\u0432\u044b\u043c \u043f\u0440\u0438\u043c\u0435\u0442 \u043f\u043e\u0441\u043b\u0430\u043d\u0438\u0435 &quot;\u042f \u0437\u0434\u0435\u0441\u044c!&quot; \u0441\u0440\u0430\u0437\u0443 \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442 \u0441\u0435\u0431\u0435 \u043d\u043e\u043c\u0435\u0440 \u0438\u0433\u0440\u043e\u043a\u0430 2.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/45a\/d75\/37d\/45ad7537d69782bbe00cca3f2ce71270.jpg\"><\/p>\n<p>  <\/p>\n<p>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 7. \u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b \u0440\u0443\u043a\u043e\u043f\u043e\u0436\u0430\u0442\u0438\u044f \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u043e\u043c\u0435\u0440\u0430 \u0438\u0433\u0440\u043e\u043a\u0430<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">void handshakePlayerId() {     long tpid = random(10, 1001) * 10;     long previousMillis = millis();     while (!serialRecivePacket())     {         unsigned long currentMillis = millis();         if (currentMillis - previousMillis &gt; tpid) break;     }     while (!serialSendPlayerTId()); }  bool serialSendPlayerTId() {     String str = &quot;&quot;;     str += (char)0x16;      str += (char)0x32; \/\/ type &quot;player id selector&quot;     str += (char)0x1d;     str += (char)0x03;      return serialWriteStr(str); }<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"shag-11-upakuem-i-raspakuem-paket-s-kartoy\">\u0428\u0430\u0433 11. \u0423\u043f\u0430\u043a\u0443\u0435\u043c \u0438 \u0440\u0430\u0441\u043f\u0430\u043a\u0443\u0435\u043c \u043f\u0430\u043a\u0435\u0442 \u0441 \u043a\u0430\u0440\u0442\u043e\u0439<\/h3>\n<p>  <\/p>\n<pre><code class=\"plaintext\">bool serialSendDeckCards() {     String str = &quot;&quot;;     str += (char)0x16;      str += (char)0x31; \/\/ type &quot;card transfer flag&quot;     str += (char)0x1d;      for (int i = 0; i &lt; fullAmount; i++)     {         str += (char)0x1e;          str += deckCards[i].card;         str += (char)0x1f;          str += deckCards[i].suit;         str += (char)0x1f;         str += deckCards[i].color;         str += (char)0x1f;         str += deckCards[i].property;         str += (char)0x1f;         str += deckCards[i].field;     }     str += (char)0x03;      return serialWriteStr(str); }  void updateReciveDeckCards(String groupData) {     for (int i = 0; i &lt; fullAmount; i++)     {         \/* update new card *\/         String record = parseString(i, (char)0x1e, groupData);         deckCards[i].card = (int8_t)(parseString(0, (char)0x1f, record).toInt());         deckCards[i].suit = (int8_t)(parseString(1, (char)0x1f, record).toInt());         deckCards[i].color = (int8_t)(parseString(2, (char)0x1f, record).toInt());         deckCards[i].property = (int8_t)(parseString(3, (char)0x1f, record).toInt());         deckCards[i].field = (int8_t)(parseString(4, (char)0x1f, record).toInt());     }     getTrumpCard();     updateGraphics();     checkWinner(); }<\/code><\/pre>\n<p>  <\/p>\n<blockquote><p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, getTrumpCard()) \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u043f\u043e\u043b\u043d\u043e\u043c \u0441\u043a\u0435\u0442\u0447\u0435 \u0438\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043b\u0443\u0447\u0448\u0435 \ud83d\ude09<\/p><\/blockquote>\n<p>  <\/p>\n<h3 id=\"shag-12-napishem-funkciyu-sinhronizacii\">\u0428\u0430\u0433 12. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438<\/h3>\n<p>  <\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e \u0444\u0430\u043a\u0442\u0443 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0439 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u0426\u0435\u043b\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u0445 \u0438\u0433\u0440\u043e\u043a\u043e\u0432 \u0438 \u043e\u0431\u043c\u0435\u043d \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439. \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0440\u0443\u0447\u043d\u043e\u043c \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u0438\u0437 \u0446\u0438\u043a\u043b\u0430 loop(). \u041a\u043e\u0433\u0434\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0438\u0433\u0440\u043e\u043a\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u0440\u0443\u0447\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0438\u0433\u0440\u043e\u043a\u0430. \u0412 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u044d\u0442\u0430 \u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 \u0441\u043e\u043f\u0435\u0440\u043d\u0438\u043a\u0430.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">void sync(bool auto_ = false) {     if (queue != playerId)      {         while (!serialRecivePacket());         queue = playerId;     }     else     {         if (!auto_)         {           while (!serialSendDeckCards());           updateGraphics();           checkWinner();           queue = getOpponentId();         }     } }<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"shag-13-kto-zhe-vyigral\">\u0428\u0430\u0433 13. \u041a\u0442\u043e \u0436\u0435 \u0432\u044b\u0438\u0433\u0440\u0430\u043b?<\/h3>\n<p>  <\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f whoWin() \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u043e\u043c\u0435\u0440 \u0438\u0433\u0440\u043e\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0438\u0433\u0440\u0430\u043b \u0438\u043b\u0438 -1, \u0435\u0441\u043b\u0438 \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0432\u044b\u0438\u0433\u0440\u0430\u043b.<br \/>  \u041f\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c \u0438\u0433\u0440\u044b \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0443 \u0438\u0433\u0440\u043e\u043a\u0430 \u043d\u0435 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043d\u0438 \u043e\u0434\u043d\u043e\u0439 \u043a\u0430\u0440\u0442\u044b, \u0442\u043e \u043e\u043d \u0432\u044b\u0438\u0433\u0440\u0430\u043b. \u0415\u0441\u043b\u0438 \u0443 \u0438\u0433\u0440\u043e\u043a\u0430 10 (playerFieldAmount) \u0438 \u0431\u043e\u043b\u0435\u0435 \u043a\u0430\u0440\u0442, \u0442\u043e \u043e\u043d \u043f\u0440\u043e\u0438\u0433\u0440\u0430\u043b.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">int whoWin() {     int opponentId = getOpponentId();     int playerAmount_ = getAmount(playerId);     int opponentAmount = getAmount(opponentId);     if ((playerAmount_ == 0) || (opponentAmount &gt;= playerFieldAmount)) return playerId;     if ((opponentAmount == 0) || (playerAmount_ &gt;= playerFieldAmount)) return opponentId;     return -1;  }  void checkWinner() {     int winner = whoWin();     if (winner != -1) drawWinnerShow(winner); }<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"shag-14-soberyom-ves-kod-voedino-i-zagruzim-ego-v-ustroystvo\">\u0428\u0430\u0433 14. \u0421\u043e\u0431\u0435\u0440\u0451\u043c \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u0432\u043e\u0435\u0434\u0438\u043d\u043e \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u0435\u0433\u043e \u0432 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e<\/h3>\n<p>  <\/p>\n<blockquote><p>\u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435: \u044d\u0442\u043e \u043c\u043e\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u0433\u0440\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f beta-\u0432\u0435\u0440\u0441\u0438\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0431\u0430\u0433\u0438 \u0438 \u043e\u0448\u0438\u0431\u043a\u0438. \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435!<\/p><\/blockquote>\n<p>\u0421\u043a\u0430\u0447\u0430\u0442\u044c \u0441\u043a\u0435\u0442\u0447 \u0434\u043b\u044f Arduino IDE \u043c\u043e\u0436\u043d\u043e \u0432\u043d\u0438\u0437\u0443 \u0443\u0440\u043e\u043a\u0430 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0438.<\/p>\n<p>  <\/p>\n<h3 id=\"shag-15-zapusk\">\u0428\u0430\u0433 15. \u0417\u0430\u043f\u0443\u0441\u043a<\/h3>\n<p>  <\/p>\n<p>\u0421\u043e\u0435\u0434\u0438\u043d\u0438\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u0440\u0442\u0430 (\u0440\u0438\u0441. 5.1). \u0418 \u043d\u0430\u0436\u043c\u0451\u043c \u043a\u0440\u0430\u0441\u043d\u044b\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u043d\u0430 \u043e\u0431\u043e\u0438\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445 (\u0440\u0438\u0441. 8). \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u044b\u0433\u0440\u0430\u0442\u044c! (\u0440\u0438\u0441. 8.1).<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/e4a\/be2\/5f5\/e4abe25f50720521801ed574d3a148fe.jpg\"><\/p>\n<p>  <\/p>\n<p>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 8. \u041f\u0435\u0440\u0432\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u0438\u0433\u0440\u044b<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/51a\/06e\/5d0\/51a06e5d045e693cafb24f828681a1f6.jpg\"><\/p>\n<p>  <\/p>\n<p>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 8.1. \u0418\u0433\u0440\u0430\u0435\u043c!<\/p>\n<p>  <\/p>\n<h2 id=\"zagruzki--ssylki\">\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \\ \u0421\u0441\u044b\u043b\u043a\u0438<\/h2>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u043e\u0431\u0440\u0435\u0441\u0442\u0438 M5Stack \u043c\u043e\u0436\u043d\u043e <a href=\"http:\/\/ru.m5stack.com\" rel=\"nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a><br \/>  \u0421\u043a\u0435\u0442\u0447 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0437\u0434\u0435\u0441\u044c <a href=\"https:\/\/yadi.sk\/d\/i3fwMYoK3SUEoB\" rel=\"nofollow\">https:\/\/yadi.sk\/d\/i3fwMYoK3SUEoB<\/a><\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/492652\/\"> https:\/\/habr.com\/ru\/post\/492652\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/492652\/\">\n<h2 id=\"cel-uroka\">\u0426\u0435\u043b\u044c \u0443\u0440\u043e\u043a\u0430<\/h2>\n<p>  <\/p>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u0435\u0442\u0435\u0432\u0443\u044e \u043a\u0430\u0440\u0442\u043e\u0447\u043d\u0443\u044e \u0438\u0433\u0440\u0443 \u043d\u0430 \u0434\u0432\u0443\u0445 \u0438\u0433\u0440\u043e\u043a\u043e\u0432. \u041a\u0430\u043a\u0443\u044e \u0438\u0433\u0440\u0443 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0443\u044e \u043a\u0430\u0440\u0442\u043e\u0447\u043d\u0443\u044e \u0438\u0433\u0440\u0443 &quot;\u0414\u0443\u0440\u0430\u043a&quot;, \u0446\u0435\u043b\u044c \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u2014 \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u0432\u0441\u0435\u0445 \u043a\u0430\u0440\u0442. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u0445 \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u0437\u0434\u0435\u0441\u044c:<br \/>  <a href=\"https:\/\/en.wikipedia.org\/wiki\/Durak\" rel=\"nofollow\">https:\/\/en.wikipedia.org\/wiki\/Durak<\/a><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/2bc\/4b7\/69d\/2bc4b769db51d266ee7fc7d18e88c475.jpg\"><\/p>\n<p>  <\/p>\n<p>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 1.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-300250","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/300250","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=300250"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/300250\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=300250"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=300250"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=300250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}