{"id":207740,"date":"2013-12-28T20:43:02","date_gmt":"2013-12-28T16:43:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=207740"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=207740","title":{"rendered":"<span class=\"post_title\">\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0411\u0440\u0435\u0437\u0435\u043d\u0445\u044d\u043c\u0430 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u2014 \u0447\u0430\u0441\u0442\u044c \u0432\u0442\u043e\u0440\u0430\u044f<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u0442\u0430 <a href=\"http:\/\/habrahabr.ru\/post\/205654\/\">\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0411\u0440\u0435\u0437\u0435\u043d\u0445\u044d\u043c\u0430 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438<\/a><\/p>\n<p>  \u041d\u0430\u043f\u043e\u043c\u043d\u0438\u043c, \u0447\u0442\u043e \u0440\u0435\u0447\u044c \u0438\u0434\u0435\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0432\u044b\u0432\u043e\u0434\u0430 \u0434\u043b\u044f \u043b\u0430\u0437\u0435\u0440\u043d\u044b\u0445 \u0441\u043a\u0430\u043d\u0430\u0442\u043e\u0440\u043e\u0432 <br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/010\/04f\/65f\/01004f65fadc9eae45c81fee23dc39fb.jpg\" alt=\"image\"\/><br \/>  <a name=\"habracut\"><\/a><br \/>  \u0412 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043b\u0430\u0437\u0435\u0440\u043d\u044b\u0439 \u0441\u043a\u0430\u043d\u0430\u0442\u043e\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0439 <a href=\"http:\/\/wiki.laser.ru\/index.php\/%D0%9B%D0%B0%D0%B7%D0%B5%D1%80%D0%BD%D0%B0%D1%8F_%D1%81%D1%82%D0%B5%D1%80%D0%B5%D0%BE%D0%BB%D0%B8%D1%82%D0%BE%D0%B3%D1%80%D0%B0%D1%84%D0%B8%D1%8F\">\u043b\u0430\u0437\u0435\u0440\u043d\u043e\u0439 \u0441\u0442\u0435\u0440\u0435\u043e\u043b\u0438\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438<\/a>, \u0433\u0434\u0435 \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0434\u0435\u0442 \u043b\u0443\u0447\u043e\u043c \u0443\u043b\u044c\u0442\u0440\u0430\u0444\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u043e\u0433\u043e \u043b\u0430\u0437\u0435\u0440\u0430 \u043f\u043e \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u0438 \u0436\u0438\u0434\u043a\u043e\u0433\u043e \u0444\u043e\u0442\u043e\u043f\u043e\u043b\u0438\u043c\u0435\u0440\u0430. \u0413\u043b\u0430\u0437\u043e\u043c \u0443\u043b\u044c\u0442\u0440\u0430\u0444\u0438\u043e\u043b\u0435\u0442 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c <i>\u0433\u0430\u0440\u043c\u043e\u043d\u0438\u043a\u0438<\/i> (\u0438\u0437\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u0430\u043b\u043e\u0439 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u0438 \u0432 \u0432\u0438\u0434\u0438\u043c\u043e\u043c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u043b\u0430\u0437\u0435\u0440\u0435 \u043d\u0430 \u043d\u0435\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0434\u043b\u0438\u043d\u0435 \u0432\u043e\u043b\u043d\u044b) \u0430 \u0442\u0430\u043a \u0436\u0435 \u0444\u043b\u044e\u043e\u0440\u0435\u0441\u0446\u0435\u043d\u0446\u0438\u044e \u043e\u0442 \u0444\u043e\u0442\u043e\u043f\u043e\u043b\u0438\u043c\u0435\u0440\u0430 \u0438\u043b\u0438 \u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0431\u0435\u043b\u043e\u0439 \u043c\u0435\u043b\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0431\u0443\u043c\u0430\u0433\u0438.<br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/aed\/ef2\/b75\/aedef2b753276850c0524de546ce9098.jpg\" alt=\"image\"\/><br \/>  \u0422\u0443\u0442 \u043d\u0430 \u0441\u043d\u0438\u043c\u043a\u0435 \u2014 \u043c\u0435\u043b\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0431\u0443\u043c\u0430\u0433\u0430, \u0441\u043b\u0435\u0433\u043a\u0430 \u043f\u0440\u043e\u043f\u0438\u0442\u0430\u0432\u0448\u0430\u044f\u0441\u044f \u0444\u043e\u0442\u043e\u043f\u043e\u043b\u0438\u043c\u0435\u0440\u043e\u043c, \u043d\u0430 \u043f\u043e\u043a\u0440\u043e\u0432\u043d\u043e\u043c \u0441\u0442\u0435\u043a\u043b\u0435 \u043d\u0430\u043d\u0435\u0441\u0435\u043d \u0441\u043b\u043e\u0439 \u0444\u043e\u0442\u043e\u043f\u043e\u043b\u0438\u043c\u0435\u0440\u0430 \u0442\u043e\u043b\u0449\u0438\u043d\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 1 \u043c\u043c, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0440\u0438\u0441\u0443\u0435\u0442\u0441\u044f, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u043b\u044e\u0431\u0438\u043c\u043e\u0435 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0441\u043b\u043e\u0432\u043e. \u0421\u043b\u0435\u0432\u0430 \u2014 \u00ab\u0442\u043e\u0447\u043a\u0430 \u043e\u0442\u0441\u0442\u043e\u044f\u00bb, \u043a\u0443\u0434\u0430 \u043b\u0443\u0447 \u0443\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0441\u043b\u0435 \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f. \u0421\u043b\u0435\u0434 \u043c\u0435\u0436\u0434\u0443 \u0440\u0438\u0441\u0443\u043d\u043a\u043e\u043c \u0438 \u0442\u043e\u0447\u043a\u043e\u0439 \u043e\u0442\u0441\u0442\u043e\u044f \u2014 \u044d\u0442\u043e <i>\u0445\u043e\u043b\u043e\u0441\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u0431\u0440\u043e\u0441<\/i> \u043b\u0443\u0447\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430 \u0441\u0447\u0435\u0442 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u0441\u043b\u0435\u0441\u0432\u0435\u0447\u0435\u043d\u0438\u044f \u0444\u043b\u044e\u043e\u0440\u0435\u0441\u0446\u0435\u043d\u0446\u0438\u0438 \u0431\u0443\u043c\u0430\u0433\u0438. \u0412 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0432\u0448\u0435\u0433\u043e\u0441\u044f \u0440\u0430\u043d\u0435\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u044d\u0442\u043e\u0442 \u043f\u0435\u0440\u0435\u0431\u0440\u043e\u0441 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u043a \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435  <\/p>\n<pre><code class=\"cpp\">   putXY(x,y, wait); \/\/  \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, x=32000, y=32000    putXY(x0,y0, wait); \/\/ y\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, x0=100, y0=100 - \u0442\u043e\u0447\u043a\u0430 \u043e\u0442\u0441\u0442\u043e\u044f <\/code><\/pre>\n<p>  \u041d\u0438\u043a\u0430\u043a\u0438\u0445 \u00ab\u0437\u0438\u0433\u0437\u0430\u0433\u043e\u0432\u00bb \u0438\u043b\u0438 \u00ab\u043f\u0435\u0442\u0435\u043b\u044c\u00bb \u0443 \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u0441\u043a\u0430\u043d\u0430\u0442\u043e\u0440\u0430 \u043c\u044b \u043d\u0435 \u0443\u0432\u0438\u0434\u0438\u043c. \u041f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u2014 \u0433\u043b\u0430\u0437\u043e\u043c.<\/p>\n<p>  \u0425\u043e\u0442\u044f \u0435\u0441\u043b\u0438 \u0440\u044f\u0434\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u044d\u043b\u0435\u043a\u0442\u0440\u043e-\u043c\u0430\u0433\u043d\u0438\u0442\u043d\u043e\u0439 \u043f\u043e\u043c\u0435\u0445\u0438 \u0442\u0438\u043f\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u0438\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0435 <br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/c31\/4d6\/464\/c314d646470cdd38de6c0b8ceda8e25a.jpg\" alt=\"image\"\/><\/p>\n<p>  \u0412\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u0442\u0435\u043f\u0435\u0440\u044c \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0443. \u0412 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0445 \u043a \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0434\u043e\u0433\u0430\u0434\u0430\u043b\u0441\u044f, \u0447\u0442\u043e \u0436\u0435 \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0411\u0440\u0435\u0437\u0435\u043d\u0445\u044d\u043c\u0430.<br \/>  \u0423 \u0432\u0438\u0434\u0438\u043c \u043c\u044b \u0432\u043e\u0442 \u0442\u0430\u043a\u0443\u044e \u0448\u0442\u0443\u043a\u0443 <br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/274\/38b\/9c6\/27438b9c6310c08fe6ded4eaacfbf66a.jpg\" alt=\"image\"\/><\/p>\n<p>  \u0421\u043b\u0435\u0432\u0430 \u2014 \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c, \u0441\u043f\u0440\u0430\u0432\u0430 \u2014 \u0442\u043e, \u0447\u0442\u043e \u043e\u0436\u0438\u0434\u0430\u043b\u0438 \u0443\u0432\u0438\u0434\u0435\u0442\u044c.<br \/>  \u041a\u043e\u0440\u043e\u0442\u043a\u0438\u0435 \u044f\u0440\u043a\u0438\u0435 \u0447\u0451\u0440\u0442\u043e\u0447\u043a\u0438 \u0433\u043e\u0432\u043e\u0440\u044f\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043d\u043e\u0433\u0434\u0430 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442\u0441\u044f. \u041a\u0430\u043a \u0436\u0435 \u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0442\u044c\u0441\u044f, \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043c\u043d\u043e\u0433\u043e\u0437\u0430\u0434\u0430\u0447\u043d\u043e\u0441\u0442\u0438 \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b? \u041e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u2014 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f! \u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u043d\u0435 \u043d\u0430\u0433\u0440\u0443\u0436\u0435\u043d \u043d\u0438\u043a\u0430\u043a\u0438\u043c \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438, \u043a\u0440\u043e\u043c\u0435 \u0432\u044b\u0434\u0430\u0447\u0438 \u043d\u0430 \u0426\u0410\u041f\u044b, \u0443 \u043d\u0430\u0441 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u0441 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0435\u0440\u0435\u0437 UART (COM-\u043f\u043e\u0440\u0442) \u0438\u043b\u0438 Ethernet. \u0412\u0440\u043e\u0434\u0435 \u0431\u044b \u043d\u0435 \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0438 \u0432\u0440\u043e\u0434\u0435 \u0431\u044b \u043d\u0435 \u0442\u0430\u043a \u0447\u0430\u0441\u0442\u043e \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u043e\u043f\u0440\u043e\u0441. \u0427\u0451\u0440\u0442\u043e\u0447\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438 \u043a\u043e\u0440\u043e\u0447\u0435, \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u044f\u0441\u044c \u0432 \u0442\u043e\u0447\u043a\u0438, \u043d\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442 \u043d\u0438\u0445 \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u0441\u044f \u043f\u0440\u0438 \u0442\u0430\u043a\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e<\/p>\n<pre><code class=\"cpp\">void   putpixel(int x, int y, int wait)) {    outPortX(x);  \/\/ \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0430 \u0426\u0410\u041f X \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 x       outPortY(y);  \/\/ \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0430 \u0426\u0410\u041f Y \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 y        delay(wait); \/\/ \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 wait  \u0435\u0434\u0438\u043d\u0438\u0446 \u0442\u0430\u0439\u043c\u0435\u0440\u0430 }   <\/code><\/pre>\n<p>  \u0427\u0430\u0441\u0442\u043e \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u0434\u0435\u043b\u0430\u044e\u0442 \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0435  <\/p>\n<pre><code class=\"cpp\">void    delay(int wait) \/\/ \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 wait  \u0435\u0434\u0438\u043d\u0438\u0446 &quot;\u0442\u0430\u0439\u043c\u0435\u0440\u0430&quot; { int i;   for(i=0;i&lt;wait; i++); } <\/code><\/pre>\n<p>  \u0414\u0451\u0448\u0435\u0432\u043e \u0438 <s>\u0441\u0435\u0440\u0434\u0438\u0442\u043e<\/s> \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0442\u0430\u043a\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0443\u0437\u043d\u0430\u0435\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u00ab\u0443\u0445\u043e\u0434\u0438\u043b\u0430\u00bb \u0432 \u0434\u0440\u0443\u0433\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0448\u043b\u043e. \u0418\u0434\u0435\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u044b\u0439 \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u0442\u0430\u0439\u043c\u0435\u0440\u0430  <\/p>\n<pre><code class=\"cpp\">void    delay(int wait)  {  unsigned int t0;    t0 = \/LPC_TIM1-&gt;TC \/\/LPC_TIM1-&gt;TC  - \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0430\u0434\u0440\u0435\u0441 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0430 \u0442\u0430\u0439\u043c\u0435\u0440\u0430 \u0439  \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445 LPC 17xx   while(LPC_TIM1-&gt;TC - t0 &lt; wait);  } <\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0443\u0437\u043d\u0430\u0435\u0442 \u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u0435\u0434\u0448\u0435\u043c \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0438, \u0445\u043e\u0442\u044f \u0438 \u043d\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u0443\u044e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u00ab\u0434\u043e \u0442\u0430\u043a\u0442\u0430\u00bb \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430. \u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442 \u0432 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430\u0445 \u044d\u0442\u0438\u043c \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u0441\u044f, \u043e\u0434\u043d\u0430\u043a\u043e \u0434\u043b\u044f \u0441\u043b\u0443\u0447\u0430\u044f \u0431\u044b\u0441\u0442\u0440\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0442\u0430\u0439\u043c\u0435\u0440\u0430 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0441\u043a\u0432\u043e\u0437\u043d\u044b\u043c  <\/p>\n<pre><code class=\"cpp\">\/* real time Bresenham alg. implementation *\/ void Line(int x1, int y1, int x2, int y2, int wait) {  int x1,y1,dx,dy,sx,sy,d,d1,d2;    unsigned int t0  = LPC_TIM1-&gt;TC;    int i, x,y;     if( x2 &gt;= x1)    {  dx = x2 - x1;       sx = 1;    } else {       dx = x1 - x2;        sx = -1;    }     if( y2 &gt;= y1)    {  dy = y2 - y1;       sy = 1;    } else {       dy = y1 - y2;        sy = -1;    }   \/****************************\/    if(dy &lt;= dx)     {  d = (dy &lt;&lt; 1) - dx;       d1 = dy &lt;&lt; 1;       d2 = (dy - dx) &lt;&lt; 1;      for(x=x1+sx,y=y1,i=1; i &lt;= dx ; i++,x+=sx)       {  if(d &gt; 0)          {  d += d2;             y += sy;             putXY(x,y,wait,&t0);          } else {             d += d1;             putX(x, wait, &t0);          }          }     } else {       d  = (dx &lt;&lt; 1) - dy;       d1 = dx &lt;&lt; 1;       d2 = (dx - dy) &lt;&lt; 1;        for(x=x1,y=y1+sy,i=1;i &lt;= dy ; i++,y += sy)       {  if(d &gt; 0)          {  d += d2;             x += sx;             putXY(x,y,wait, &t0);          } else {             d += d1;             putY(y, wait, &t0);          }          }     } \/* endif(dy &lt;=dx) *\/ }  void putXY(int x, int y, int wait, unsigned int *pT0) {     outPortXY(x,y);  \/\/ \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0430 \u0426\u0410\u041f\u0430\u0445 X \u0438 Y \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f x \u0438 y                                    \/\/ \u0432 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435   #define outPortXY(x,y)   outPortX(x); outPortY(y);  \/* \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 wait  \u0435\u0434\u0438\u043d\u0438\u0446 \u0442\u0430\u0439\u043c\u0435\u0440\u0430 *\/   while(LPC_TIM1-&gt;TC - *pT0 &lt; wait);    *pT0 += wait; }    void putX(int x,  int wait, unsigned int *pT0) {     outPortX(x);  \/\/ \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0430 \u0426\u0410\u041f X \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 x \/* \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 wait  \u0435\u0434\u0438\u043d\u0438\u0446 \u0442\u0430\u0439\u043c\u0435\u0440\u0430 *\/   while(LPC_TIM1-&gt;TC - *pT0 &lt; wait);    *pT0 += wait; }   void putY(int y,  int wait, unsigned int *pT0) {     outPortY(y);  \/\/ \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0430 \u0426\u0410\u041f Y \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 y \/* \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 wait  \u0435\u0434\u0438\u043d\u0438\u0446 \u0442\u0430\u0439\u043c\u0435\u0440\u0430 *\/   while(LPC_TIM1-&gt;TC - *pT0 &lt; wait);    *pT0 += wait; }   <\/code><\/pre>\n<p>  \u0417\u0430\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0432 \u044d\u0442\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0430 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u043d\u0430 \u0426\u0410\u041f \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u0430\u043d\u0430\u043b\u0430 \u0438\u043b\u0438 \u0434\u0432\u0443\u0445 \u043a\u0430\u043d\u0430\u043b\u043e\u0432, \u0442\u0430\u043a \u0438 \u0440\u0430\u0437\u0431\u0440\u043e\u0441 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u0432\u043e\u0434\u0430, \u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u0432\u043e\u0434 \u0434\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0433\u043e\u0442\u043e\u0432\u043d\u043e\u0441\u0442\u0438. <\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Line(), \u0432\u043d\u0435 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u044d\u0444\u0444\u0435\u043a\u0442 \u0432\u043b\u0438\u044f\u043d\u0438\u044f \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u043d\u0430 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044e \u043d\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u0442\u0440\u0443\u0434\u0430 \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f, \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u0432 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435.<\/p>\n<p>  \u041d\u0443 \u0438 \u043d\u0430\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a \u2014 \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0430\u0445\u043e\u043c\u0443\u0442\u0430\u043b\u0438 \u0441 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439, \u0442\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u0430\u043c\u044b\u0435 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u0433\u043e\u0433\u0443\u043b\u0438\u043d\u044b \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u043a\u0440\u0443\u0433\u0430 \u0438 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0430.<br \/>  <img decoding=\"async\" src=\"http:\/\/ic.pics.livejournal.com\/evgen2\/13024726\/124833\/124833_600.jpg\" alt=\"image\"\/> <br \/>  \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u00ab\u0432\u0441\u0451 \u043f\u043e\u0447\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e\u00bb, \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u044f\u0432\u043b\u044f\u043b\u0438\u0441\u044c \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0435 \u0437\u0443\u0431\u0447\u0438\u043a\u0438. \u041a\u0430\u043a \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u043e\u0434\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0430 <i> y += sy; <\/i> \u0431\u044b\u043b\u0430 \u0437\u0430\u043c\u0435\u043d\u0435\u043d\u0430 \u043d\u0430 <i> x += sx;<\/i>. \u041c\u0435\u0436\u0434\u0443 \u043f\u0440\u043e\u0447\u0438\u043c, \u0438\u0437-\u0437\u0430 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u0437\u0430\u0434\u0435\u0442\u043e\u0433\u043e \u0442\u0430\u0447\u043f\u0430\u0434\u0430 \u043d\u0430 \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0435.    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/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=\"http:\/\/habrahabr.ru\/post\/207740\/\"> http:\/\/habrahabr.ru\/post\/207740\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u0442\u0430 <a href=\"http:\/\/habrahabr.ru\/post\/205654\/\">\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0411\u0440\u0435\u0437\u0435\u043d\u0445\u044d\u043c\u0430 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438<\/a><\/p>\n<p>  \u041d\u0430\u043f\u043e\u043c\u043d\u0438\u043c, \u0447\u0442\u043e \u0440\u0435\u0447\u044c \u0438\u0434\u0435\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0432\u044b\u0432\u043e\u0434\u0430 \u0434\u043b\u044f \u043b\u0430\u0437\u0435\u0440\u043d\u044b\u0445 \u0441\u043a\u0430\u043d\u0430\u0442\u043e\u0440\u043e\u0432 <br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/010\/04f\/65f\/01004f65fadc9eae45c81fee23dc39fb.jpg\" alt=\"image\"\/>  <\/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-207740","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/207740","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=207740"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/207740\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=207740"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=207740"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=207740"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}