{"id":353431,"date":"2024-05-20T22:27:50","date_gmt":"2024-05-20T22:27:50","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=353431"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=353431","title":{"rendered":"<span>\u0417\u043d\u0430\u043a\u043e\u043c\u0438\u043c\u0441\u044f \u0441 RepkaPi.GPIO SysFS. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 GPIO \u0447\u0435\u0440\u0435\u0437 Python 3. \u0422\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0441\u043d\u043e\u0432\u044b \u0440\u0430\u0431\u043e\u0442\u044b GPIO \u043f\u043e\u0440\u0442\u043e\u0432<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h3>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435<\/h3>\n<ol>\n<li>\n<p><a href=\"#1\" rel=\"noopener noreferrer nofollow\">\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#2\" rel=\"noopener noreferrer nofollow\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#3\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#4\" rel=\"noopener noreferrer nofollow\">\u041c\u0435\u0442\u043e\u0434\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#5\" rel=\"noopener noreferrer nofollow\">\u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439<\/a><\/p>\n<ol>\n<li>\n<p><a href=\"#51\" rel=\"noopener noreferrer nofollow\">\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u043f\u043b\u0430\u0442\u0435<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#52\" rel=\"noopener noreferrer nofollow\">\u0420\u0435\u0436\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0438\u043d\u043e\u0432<\/a><\/p>\n<ol>\n<li>\n<p><a href=\"#521\" rel=\"noopener noreferrer nofollow\">\u0420\u0435\u0436\u0438\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f (OUTPUT)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#522\" rel=\"noopener noreferrer nofollow\">\u0420\u0435\u0436\u0438\u043c \u0447\u0442\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f (INPUT)<\/a><\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p><a href=\"#53\" rel=\"noopener noreferrer nofollow\">\u0427\u0442\u0435\u043d\u0438\u0435 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439<\/a><\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p><a href=\"#6\" rel=\"noopener noreferrer nofollow\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/a><\/p>\n<\/li>\n<\/ol>\n<p><a class=\"anchor\" name=\"1\" id=\"1\"><\/a><\/p>\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/70c\/4c7\/508\/70c4c750887393d706e31ac73c7595b2.jpg\" width=\"619\" height=\"819\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/70c\/4c7\/508\/70c4c750887393d706e31ac73c7595b2.jpg\" data-blurred=\"true\"\/><\/figure>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 RepkaPi.GPIO, \u0434\u0430\u043d\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0430 Python 3 \u0438 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f GPIO \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043c\u0435\u0442\u043e\u0434\u044b, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 SysFS. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0439 \u043f\u0440\u043e SysFS \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0430 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/Sysfs\" rel=\"noopener noreferrer nofollow\">wikipedia<\/a>.<\/p>\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0431\u044b\u043b\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 RPI.GPIO \u0434\u043b\u044f Raspberry Pi \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u0412\u0430\u0448\u0438\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432.<\/p>\n<p>\u041f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430 gitflic.ru: <a href=\"https:\/\/gitflic.ru\/project\/repka_pi\/repkapigpiofs\" rel=\"noopener noreferrer nofollow\">https:\/\/gitflic.ru\/project\/repka_pi\/repkapigpiofs<\/a>.<\/p>\n<p><a class=\"anchor\" name=\"2\" id=\"2\"><\/a><\/p>\n<h3>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430<\/h3>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b.<\/p>\n<p>\u041e\u0431\u043d\u043e\u0432\u0438\u043c \u0438\u043d\u0434\u0435\u043a\u0441 \u043f\u0430\u043a\u0435\u0442\u043e\u0432<\/p>\n<pre><code class=\"bash\">sudo apt-get update<\/code><\/pre>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b<\/p>\n<pre><code class=\"bash\">sudo apt-get install python3-dev python3-setuptools git<\/code><\/pre>\n<p>\u041a\u043b\u043e\u043d\u0438\u0440\u0443\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/p>\n<pre><code class=\"bash\">git clone https:\/\/gitflic.ru\/project\/repka_pi\/repkapigpiofs.git<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443<\/p>\n<pre><code class=\"bash\">cd repkapigpiofs<\/code><\/pre>\n<p>* \u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0430\u0440\u0445\u0438\u0432\u043e\u043c \u0441 gitflic \u0438 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u0430\u0442\u044c \u0432 \u0443\u0434\u043e\u0431\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0443\u044e \u0435\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443. \u041c\u043e\u0434\u0443\u043b\u044c \u0438\u043c\u0435\u0435\u0442 \u0434\u0432\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b, \u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 <strong>RepkaPi\/constants.py<\/strong><\/p>\n<ul>\n<li>\n<p><strong>GPIO.DEFAULTBOARD<\/strong> &#8212; \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c Repka Pi \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u044c. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 None. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u043b\u0430\u0442\u0443 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439. \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 GPIO.REPKAPI3 \u0438\u043b\u0438 1, \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u0447\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 Repka Pi 3 \u0438 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e \u043f\u043b\u0430\u0442\u044b \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e.<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.AUTODETECT<\/strong> &#8212; \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 Repka Pi. \u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 True\/False, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u0432 True. \u0415\u0441\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e True \u0442\u043e <strong>GPIO.DEFAULTBOARD<\/strong> \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f.<\/p>\n<\/li>\n<\/ul>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/p>\n<pre><code class=\"bash\">sudo python3 setup.py install<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a\u0430\u044f \u043a\u043e\u043d\u0446\u043e\u0432\u043a\u0430 \u0432\u044b\u0432\u043e\u0434\u0430<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/529\/60b\/c5f\/52960bc5febf832821cc93a8811a760e.png\" width=\"729\" height=\"132\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/529\/60b\/c5f\/52960bc5febf832821cc93a8811a760e.png\"\/><\/figure>\n<h4>\u0411\u0435\u0437 root-\u0434\u043e\u0441\u0442\u0443\u043f\u0430<\/h4>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0431\u0435\u0437 \u043f\u043e\u043b\u043d\u043e\u043c\u043e\u0447\u0438\u0439 root, \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e UDEV, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u0430\u043c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0433\u0440\u0443\u043f\u043f\u0443 gpio<\/p>\n<pre><code class=\"bash\">sudo groupadd gpio<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0433\u0440\u0443\u043f\u043f\u0443 gpio<\/p>\n<pre><code class=\"bash\">sudo usermod -aG gpio &lt;\u0432\u0430\u0448 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c><\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0434\u043b\u044f udev \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/p>\n<pre><code class=\"bash\">sudo nano \/etc\/udev\/rules.d\/99-gpio.rules<\/code><\/pre>\n<p>\u0412 \u043e\u0442\u043a\u0440\u044b\u0432\u0448\u0435\u0439\u0441\u044f \u0444\u0430\u0439\u043b \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435<\/p>\n<pre><code class=\"bash\">KERNEL==\"gpio\\*\", MODE:=\"0660\", GROUP:=\"gpio\"   KERNEL==\"pwm*\", MODE:=\"0660\", GROUP:=\"gpio\"   KERNEL==\"gpiochip*\", MODE:=\"0660\", GROUP:=\"gpio\"   SUBSYSTEM==\"gpio*\", PROGRAM=\"\/bin\/sh -c 'chown -R root:gpio \/sys\/class\/gpio &amp;&amp; chmod -R 777 \/sys\/class\/gpio &amp;&amp; chown -R root:gpio \/sys\/class\/gpio\/* &amp;&amp; chmod -R 777 \/sys\/class\/gpio\/* &amp;&amp; chown -R root:gpio \/sys\/devices\/platform\/soc\/*.pinctrl\/gpio &amp;&amp; chmod -R 777 \/sys\/devices\/platform\/soc\/*.pinctrl\/gpio'\" SUBSYSTEM==\"pwm*\", PROGRAM=\"\/bin\/sh -c 'chown -R root:gpio \/sys\/class\/pwm &amp;&amp; chmod -R 777 \/sys\/class\/pwm &amp;&amp; chown -R root:gpio \/sys\/class\/pwm\/* &amp;&amp; chmod -R 777 \/sys\/class\/pwm\/* &amp;&amp; chown -R root:gpio \/sys\/class\/pwm\/pwmchip0\/* &amp;&amp; chmod -R 777 \/sys\/class\/pwm\/pwmchip0\/* &amp;&amp; chown -R root:gpio \/sys\/devices\/platform\/soc\/*.pwm\/pwm &amp;&amp; chmod -R 777 \/sys\/devices\/platform\/soc\/*.pwm\/pwm '\"<\/code><\/pre>\n<p>\u041d\u0430\u0436\u043c\u0438\u0442\u0435 <code>ctrl-x<\/code>, <code>Y<\/code> \u0438 <code>ENTER<\/code>, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0444\u0430\u0439\u043b.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0443<\/p>\n<pre><code class=\"bash\">sudo reboot<\/code><\/pre>\n<p><a class=\"anchor\" name=\"3\" id=\"3\"><\/a><\/p>\n<h3>\u041a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/h3>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0438\u043c\u0435\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0438 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0438\u0445 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0439.<\/p>\n<h4>\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435<\/h4>\n<ul>\n<li>\n<p><strong>GPIO.RPI_INFO<\/strong> &#8212; \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.VERSION<\/strong> &#8212; \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0432\u0435\u0440\u0441\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/p>\n<\/li>\n<\/ul>\n<h4>\u041c\u043e\u0434\u0435\u043b\u0438 Repka Pi (board)<\/h4>\n<ul>\n<li>\n<p><strong>GPIO.REPKAPI3<\/strong> &#8212; Repka Pi 3<\/p>\n<\/li>\n<\/ul>\n<h4>\u0420\u0435\u0436\u0438\u043c\u044b \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u044f \u043f\u0438\u043d\u043e\u0432 (mode)<\/h4>\n<ul>\n<li>\n<p><strong>GPIO.BOARD<\/strong> &#8212; 10 &#8212; \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u044f \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443 \u043e\u0442 1 \u0434\u043e 40<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.BCM<\/strong> &#8212; 11 &#8212; \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u044f \u043f\u043e Raspberry Pi 3B \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u0432 \u043d\u043e\u0432\u044b\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.SUNXI<\/strong> &#8212; 12 &#8212; \u043f\u043e \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u043c\u0443 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0435\u044e SUNXI \u201cPA0\u2026, PC\u2026, PL\u2026\u201d<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.SOC<\/strong> &#8212; 13 &#8212; \u043f\u043e \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443 \u0432 SOC, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0432 SysFS, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043d\u043e \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.SYSFS<\/strong> &#8212; \u0430\u043b\u044c\u044f\u0441 \u0434\u043b\u044f <strong>GPIO.SOC<\/strong><\/p>\n<\/li>\n<\/ul>\n<h4>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f SUNXI<\/h4>\n<ul>\n<li>\n<p><strong>GPIO.PA<\/strong> &#8212; 0<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.PC<\/strong> &#8212; 64<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.PD<\/strong> &#8212; 96<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.PE<\/strong> &#8212; 128<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.PF<\/strong> &#8212; 160<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.PG<\/strong> &#8212; 192<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.PL<\/strong> &#8212; 352<\/p>\n<\/li>\n<\/ul>\n<h4>\u0420\u0435\u0436\u0438\u043c\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0438\u043d\u0430<\/h4>\n<ul>\n<li>\n<p><strong>GPIO.IN<\/strong> &#8212; 1 &#8212; \u0440\u0435\u0436\u0438\u043c <strong>INPUT<\/strong> &#8212; \u0447\u0442\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.OUT<\/strong> &#8212; 0 &#8212; \u0440\u0435\u0436\u0438\u043c <strong>OUTPUT<\/strong> &#8212; \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f<\/p>\n<\/li>\n<\/ul>\n<h4>\u0421\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0438\u043d\u0430<\/h4>\n<ul>\n<li>\n<p><strong>GPIO.HIGH<\/strong> &#8212; 1 &#8212; \u0432\u044b\u0441\u043e\u043a\u0438\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c, \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0435\u0434\u0438\u043d\u0438\u0446\u0430<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.LOW<\/strong> &#8212; 0 &#8212; \u043d\u0438\u0437\u043a\u0438\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c, \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043d\u043e\u043b\u044c<\/p>\n<\/li>\n<\/ul>\n<h4>\u041f\u043e\u0434\u0442\u044f\u0436\u043a\u0430 \u043f\u0438\u043d\u0430<\/h4>\n<ul>\n<li>\n<p><strong>GPIO.PUD_OFF<\/strong> &#8212; \u043d\u0435 \u043f\u043e\u0434\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u0442\u0441\u044f<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.PUD_DOWN<\/strong> &#8212; \u043f\u0438\u043d \u0447\u0435\u0440\u0435\u0437 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u043a 0 (GND)<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.PUD_UP<\/strong> &#8212; \u043f\u0438\u043d \u0447\u0435\u0440\u0435\u0437 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u043a +3.3\u0412<\/p>\n<\/li>\n<\/ul>\n<blockquote>\n<p><strong><em>\u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435:<\/em><\/strong> <em>\u041f\u043e\u0434\u0442\u044f\u0436\u043a\u0430 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043f\u043e\u0434\u0442\u044f\u0436\u043a\u0443 \u0447\u0435\u0440\u0435\u0437 \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440.<\/em><\/p>\n<\/blockquote>\n<h4>\u0421\u043e\u0431\u044b\u0442\u0438\u0439\u043d\u044b\u0435<\/h4>\n<ul>\n<li>\n<p><strong>GPIO.RISING<\/strong> &#8212; \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u0441 LOW \u043d\u0430 HIGH<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.FALLING<\/strong> &#8212; \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u0441 HIGH \u043d\u0430 LOW<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.BOTH<\/strong> &#8212; \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u0432 \u043b\u044e\u0431\u043e\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435<\/p>\n<\/li>\n<\/ul>\n<p><a class=\"anchor\" name=\"4\" id=\"4\"><\/a><\/p>\n<h3>\u041c\u0435\u0442\u043e\u0434\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/h3>\n<h4>\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435<\/h4>\n<ul>\n<li>\n<p><strong>GPIO.getboardmodel()<\/strong> &#8212; \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c Repka Pi<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.getmode()<\/strong> &#8212; \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u043e\u043c\u0435\u0440 \u0440\u0435\u0436\u0438\u043c\u0430 \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0438\u043d\u043e\u0432<\/p>\n<\/li>\n<\/ul>\n<h4>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u0447\u043d\u044b\u0435<\/h4>\n<ul>\n<li>\n<p><strong>GPIO.setboard()<\/strong> &#8212; \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 Repka Pi, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/p>\n<ul>\n<li>\n<p><strong>board<\/strong> &#8212; GPIO.REPKAPI3<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>GPIO.setmode()<\/strong> &#8212; \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0440\u0435\u0436\u0438\u043c\u0430 \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0438\u043d\u043e\u0432, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/p>\n<ul>\n<li>\n<p><strong>mode<\/strong> &#8212; GPIO.BOARD, GPIO.BCM, GPIO.SUNXI \u0438\u043b\u0438 GPIO.SOC<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>GPIO.setwarnings()<\/strong> &#8212; \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f\u043c\u0438, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 True\/False<\/p>\n<\/li>\n<\/ul>\n<h4>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 GPIO<\/h4>\n<ul>\n<li>\n<p><strong>GPIO.setup()<\/strong> &#8212; \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0438\u043d\u0430, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f<\/p>\n<ul>\n<li>\n<p><strong>channel<\/strong> &#8212; \u043d\u043e\u043c\u0435\u0440 \u043f\u0438\u043d\u0430 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u0440\u0435\u0436\u0438\u043c\u043e\u043c \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u0438,<\/p>\n<\/li>\n<li>\n<p><strong>direction<\/strong> &#8212; \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c GPIO \u043f\u0438\u043d \u043a\u0430\u043a \u0432\u0445\u043e\u0434 \u0438\u043b\u0438 \u0432\u044b\u0445\u043e\u0434 (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e GPIO.IN \u0438\u043b\u0438 GPIO.OUT)<\/p>\n<\/li>\n<li>\n<p><strong>initial<\/strong> &#8212; (\u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e) \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0438\u043d\u0430 (GPIO.LOW (0) \u0438\u043b\u0438 GPIO.HIGH (1),<\/p>\n<\/li>\n<li>\n<p><strong>pull_up_down<\/strong> &#8212; (\u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e) \u043f\u043e\u0434\u0442\u044f\u0436\u043a\u0430 \u043a +3,3\u0412 (GPIO.PUD_UP), \u043a 0 (GPIO.PUD_DOWN) \u0438\u043b\u0438 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d (GPIO.PUD_OFF).<\/p>\n<blockquote>\n<p><strong><em>\u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435<\/em><\/strong>: <em>\u041f\u043e\u0434\u0442\u044f\u0436\u043a\u0430 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043e \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438<\/em><\/p>\n<\/blockquote>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>GPIO.input()<\/strong> &#8212; \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0438\u043d\u0430, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/p>\n<ul>\n<li>\n<p><strong>channel<\/strong> &#8212; \u043d\u043e\u043c\u0435\u0440 \u043f\u0438\u043d\u0430 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u0440\u0435\u0436\u0438\u043c\u043e\u043c \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u0438, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 GPIO.LOW (0) \u0438\u043b\u0438 GPIO.HIGH (1)<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>GPIO.output()<\/strong> &#8212; \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0438\u043d\u0430, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f<\/p>\n<ul>\n<li>\n<p><strong>channel<\/strong> &#8212; \u043d\u043e\u043c\u0435\u0440 \u043f\u0438\u043d\u0430 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u0440\u0435\u0436\u0438\u043c\u043e\u043c \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u0438,<\/p>\n<\/li>\n<li>\n<p><strong>state<\/strong> &#8212; \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0438\u043d\u0430 GPIO.LOW (0) \u0438\u043b\u0438 GPIO.HIGH (1)<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>GPIO.cleanup()<\/strong> &#8212; \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043f\u0438\u043d\u044b \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/p>\n<ul>\n<li>\n<p><strong>channel<\/strong> &#8212; \u043d\u043e\u043c\u0435\u0440 \u043f\u0438\u043d\u0430 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u0440\u0435\u0436\u0438\u043c\u043e\u043c \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 None (\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e) \u0447\u0442\u043e\u0431\u044b \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0432\u0441\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u0438\u043d\u044b<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong><em>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.<\/em><\/strong><\/p>\n<p><a class=\"anchor\" name=\"5\" id=\"5\"><\/a><\/p>\n<h3>\u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439<\/h3>\n<p> \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 RepkaPi.GPIO \u0432 \u0432\u0430\u0448\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u0435  <\/p>\n<pre><code class=\"python\">import RepkaPi.GPIO as GPIO<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0432\u044b \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043b\u0438 <strong>GPIO.DEFAULTBOARD<\/strong> \u0438 <strong>GPIO.AUTODETECT<\/strong> \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u0432 False \u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c Repka Pi, \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439<\/p>\n<pre><code class=\"python\">GPIO.setboard(GPIO.REPKAPI3)<\/code><\/pre>\n<p><strong>GPIO.REPKAPI3<\/strong> &#8212; \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0447\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0430 Repka Pi 3. \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c.<\/p>\n<p>\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u0430\u043a\u043e\u0439 \u043c\u044b \u0440\u0435\u0436\u0438\u043c \u0445\u043e\u0442\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c<\/p>\n<pre><code class=\"python\">GPIO.setmode(GPIO.SOC)<\/code><\/pre>\n<p>\u0412\u044b\u0448\u0435 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u201c<a href=\"#3\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/a>\u201d \u0431\u044b\u043b\u0438 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u044b \u0432\u0441\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0439 \u0447\u0435\u043c \u043e\u043d\u0438 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f.<\/p>\n<p><strong>BOARD<\/strong> &#8212; \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u0432\u043e\u043c\u0443 \u043d\u043e\u043c\u0435\u0440\u0443 \u043f\u0438\u043d\u0430 \u043d\u0430 \u043f\u043b\u0430\u0442\u0435, \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u043c \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u043f\u0438\u043d\u0443 \u043f\u043e\u0434 \u21167, \u0442\u043e \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043d\u0443\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u043e\u0436\u0435 7<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/465\/944\/9ac\/4659449acc2f03120560ae60ef3d57c6.png\" width=\"476\" height=\"250\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/465\/944\/9ac\/4659449acc2f03120560ae60ef3d57c6.png\"\/><\/figure>\n<p><strong>SUNXI<\/strong> &#8212;\u00a0 \u041e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043f\u043e \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u043c\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0443 \u0432 \u0441\u0445\u0435\u043c\u0435 \u0440\u0430\u0441\u043f\u0438\u043d\u043e\u0432\u043a\u0438, \u0435\u0441\u043b\u0438 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u044d\u0442\u043e\u0442 \u0440\u0435\u0436\u0438\u043c, \u0442\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u043f\u0438\u043d\u0443 7 \u0431\u0443\u0434\u0435\u0442 \u043a\u0430\u043a \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u201c<strong>PA7<\/strong>\u201d<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b61\/7a8\/447\/b617a84479e0ecb7a8b43181f093a527.png\" width=\"470\" height=\"290\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b61\/7a8\/447\/b617a84479e0ecb7a8b43181f093a527.png\"\/><\/figure>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c, \u043d\u043e \u0442\u043e\u0436\u0435 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p><strong>SOC \u0438 SYSFS<\/strong> &#8212; \u0447\u0438\u0441\u043b\u043e\u0432\u0430\u044f \u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u044f \u043f\u043e SOC \u0438 SYSFS \u0442.\u0435. \u0435\u0441\u043b\u0438 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0440\u0430\u0441\u043f\u0438\u043d\u043e\u0432\u043a\u0443 \u043a\u0430\u043a \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e, \u0442\u0430\u043a \u0438 \u043d\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0432 \u0441\u0442\u0430\u0442\u044c\u0435, \u0442\u043e \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b6b\/a3b\/7be\/b6ba3b7be3fae9eb7f6fb6801dd47084.png\" width=\"475\" height=\"347\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b6b\/a3b\/7be\/b6ba3b7be3fae9eb7f6fb6801dd47084.png\"\/><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0437\u0430\u0445\u043e\u0442\u0438\u0442\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u043f\u0438\u043d\u0443 \u043f\u043e\u0434 \u043d\u043e\u043c\u0435\u0440\u043e\u043c 18, \u0442\u043e \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0435\u0433\u043e \u043d\u043e\u043c\u0435\u0440 SOC\/SysFS \u0440\u0430\u0432\u043d\u044b\u0439 355, \u0442\u0430\u043a\u0436\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043f\u043e SUNX (P \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 Pin \u0435\u0435 \u043c\u044b \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c. \u0424\u043e\u0440\u043c\u0443\u043b\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f, (\u043f\u043e\u0440\u044f\u0434\u043a\u043e\u0432\u044b\u0439 \u043d\u043e\u043c\u0435\u0440 \u043b\u0430\u0442\u0438\u043d\u0441\u043a\u043e\u0439 \u0431\u0443\u043a\u0432\u0430 (L) &#8212; 1) <em>32 + \u043d\u043e\u043c\u0435\u0440 \u043f\u043e\u0441\u043b\u0435 \u043b\u0430\u0442\u0438\u043d\u0441\u043a\u043e\u0439 \u0431\u0443\u043a\u0432\u0430 (3), \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c (12-1)<\/em> 32+3=355).<\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0442.\u043a. \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f. \u0422\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0435\u0441\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b.<\/p>\n<p><strong>PA<\/strong> &#8212; 0, <strong>PC<\/strong> &#8212; 64, <strong>PD<\/strong> &#8212; 96, <strong>PE<\/strong> &#8212; 128, <strong>PF<\/strong> &#8212; 160, <strong>PG<\/strong> &#8212; 192, <strong>PL<\/strong> &#8212; 352 \u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a 18 \u043f\u0438\u043d\u0443 PL3 \u0431\u0443\u0434\u0435\u0442 \u0443\u0436\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c <strong>GPIO.PL<\/strong> + 3.<\/p>\n<p><strong>BCM<\/strong> &#8212; \u044d\u0442\u0430 \u0441\u0445\u0435\u043c\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0434\u043b\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c \u043f\u043e <strong>BCM<\/strong> \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430\u043c \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0432 Raspberry Pi. \u0415\u0441\u043b\u0438 \u043c\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0441\u0445\u0435\u043c\u0443 Raspberry Pi \u0442\u043e \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u043d\u0430 7 \u043f\u0438\u043d\u0435 \u0443 \u043d\u0435\u0433\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f GPIO4.<\/p>\n<p>\u041e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u043d\u043e\u043c\u0435\u0440\u0443 GPIO \u0442.\u0435. 4, \u0434\u0430\u043b\u044c\u0448\u0435 \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u0434\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u043a Repka Pi, \u0442.\u0435. \u043f\u043e <strong>SOC<\/strong> \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 7 \u0438\u043b\u0438 PA7 \u043f\u043e <strong>SUNXI<\/strong><\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/090\/7a9\/44b\/0907a944b0eff0cf3e68c27eb9a2f01d.png\" width=\"476\" height=\"250\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/090\/7a9\/44b\/0907a944b0eff0cf3e68c27eb9a2f01d.png\"\/><\/figure>\n<p><strong><em>\u0420\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0441\u0442\u0430\u0442\u044c\u0438 \u044d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0435 \u0431\u0443\u0434\u0435\u043c, \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0430 Repka Pi \u043e\u043d \u043d\u0435 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f.<\/em><\/strong><\/p>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c, \u0442\u043e \u043d\u0435 \u043f\u0435\u0440\u0435\u0436\u0438\u0432\u0430\u0439\u0442\u0435 \u043c\u044b \u0435\u0449\u0435 \u0431\u0443\u0434\u0435\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445, \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0440\u0430\u0437.<\/p>\n<p>\u0418 \u0442\u0430\u043a \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0432\u043e \u0432\u0441\u0435\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445, \u043d\u0430\u0437\u043e\u0432\u0435\u043c \u0438\u0445 \u0431\u0430\u0437\u043e\u0432\u044b\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438.<\/p>\n<p><a class=\"anchor\" name=\"51\" id=\"51\"><\/a><\/p>\n<h4>\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u043f\u043b\u0430\u0442\u0435<\/h4>\n<p>\u0412 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0435\u0441\u0442\u044c \u0434\u0432\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0438 \u043e\u0434\u0438\u043d \u043c\u0435\u0442\u043e\u0434 \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u043b\u0430\u0442\u0435 \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043b\u0430\u0442\u044b<\/p>\n<pre><code class=\"python\">GPIO.getboardmodel()<\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0432\u0435\u0440\u043d\u0435\u0442 \u043d\u0430\u043c<\/p>\n<pre><code class=\"bash\">Repka Pi 3<\/code><\/pre>\n<p>* \u043f\u0440\u0438 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u0438 \u043f\u043e \u043c\u0435\u0440\u0435 \u0438\u0445 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u0442\u0432\u0435\u0442\u044b.<\/p>\n<p>\u0412\u0435\u0440\u0441\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/p>\n<pre><code class=\"python\">GPIO.VERSION<\/code><\/pre>\n<p>\u0412\u0435\u0440\u043d\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u0441\u0438\u044f <code>0.1.2<\/code>, \u044d\u0442\u043e \u0432\u0435\u0440\u0441\u0438\u044f \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<p>\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435<\/p>\n<pre><code class=\"python\">GPIO.RPI_INFO<\/code><\/pre>\n<p>\u0412\u0435\u0440\u043d\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432<\/p>\n<pre><code>{'P1_REVISION': 3, 'TYPE': 'Repka Pi 3', 'MANUFACTURER': '\u0418\u041d\u0422\u0415\u041b\u041b\u0415\u041a\u0422', 'RAM': '1GB', 'REVISION': '', 'PROCESSOR': 'Allwinner H5'}<\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0432 RPI.GPIO \u0434\u043b\u044f Raspberry Pi.<\/p>\n<p>\u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043c\u043e\u0436\u043d\u043e, \u043e\u0431\u0440\u0430\u0442\u0438\u0432\u0448\u0438\u0441\u044c \u043a \u043d\u0435\u043c\u0443 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e:<\/p>\n<pre><code class=\"python\">GPIO.RPI_INFO['MANUFACTURER']<\/code><\/pre>\n<p>\u0412\u0435\u0440\u043d\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/p>\n<pre><code>\u0418\u041d\u0422\u0415\u041b\u041b\u0415\u041a\u0422<\/code><\/pre>\n<pre><code class=\"python\">GPIO.RPI_INFO['PROCESSOR']<\/code><\/pre>\n<p>\u0412\u0435\u0440\u043d\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/p>\n<pre><code>Allwinner H5<\/code><\/pre>\n<p>\u0423\u0437\u043d\u0430\u0442\u044c, \u043a\u0430\u043a\u043e\u0439 \u0440\u0435\u0436\u0438\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d<\/p>\n<pre><code class=\"python\">GPIO.getmode()<\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0432\u0435\u0440\u043d\u0435\u0442 \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u043c\u0443  \u0440\u0435\u0436\u0438\u043c\u0443 \u0438\u043b\u0438 None. \u0414\u0430\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442.<\/p>\n<p><a class=\"anchor\" name=\"52\" id=\"52\"><\/a><\/p>\n<h4>\u0420\u0435\u0436\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0438\u043d\u043e\u0432<\/h4>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0440\u0435\u0436\u0438\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0438\u043d\u0430. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 18 \u043f\u0438\u043d\u0430<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e6f\/408\/75f\/e6f40875f4f2fb254a125b5cc6ded2b5.png\" width=\"659\" height=\"273\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e6f\/408\/75f\/e6f40875f4f2fb254a125b5cc6ded2b5.png\"\/><\/figure>\n<p>\u041f\u0438\u043d \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c 2 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 &#8212; <strong>INPUT<\/strong> (\u0440\u0435\u0436\u0438\u043c \u0447\u0442\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f) \u0438 <strong>OUTPUT<\/strong> (\u0440\u0435\u0436\u0438\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f).<\/p>\n<p>\u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043c\u0435\u0442\u043e\u0434 <code>GPIO.setup(channel, direction, initial=None, pull_up_down=None)<\/code><\/p>\n<ul>\n<li>\n<p><strong>channel<\/strong> &#8212; \u043d\u043e\u043c\u0435\u0440 \u043f\u0438\u043d\u0430 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u0440\u0435\u0436\u0438\u043c\u043e\u043c \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u0438,<\/p>\n<\/li>\n<li>\n<p><strong>direction<\/strong> &#8212; \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c GPIO \u043f\u0438\u043d \u043a\u0430\u043a \u0432\u0445\u043e\u0434 \u0438\u043b\u0438 \u0432\u044b\u0445\u043e\u0434 (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e GPIO.IN \u0438\u043b\u0438 GPIO.OUT)<\/p>\n<\/li>\n<li>\n<p><strong>initial<\/strong> &#8212; (\u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e) \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0438\u043d\u0430 (GPIO.LOW (0) \u0438\u043b\u0438 GPIO.HIGH (1),<\/p>\n<\/li>\n<li>\n<p><strong>pull_up_down<\/strong> &#8212; (\u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e) \u043f\u043e\u0434\u0442\u044f\u0436\u043a\u0430 \u043a +3,3\u0412 (GPIO.PUD_UP), \u043a 0 (GPIO.PUD_DOWN) \u0438\u043b\u0438 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d (GPIO.PUD_OFF)<\/p>\n<\/li>\n<\/ul>\n<h4>\u0420\u0435\u0436\u0438\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f (OUTPUT)<\/h4>\n<p><a class=\"anchor\" name=\"521\" id=\"521\"><\/a><\/p>\n<p><strong>\u0412 \u0440\u0435\u0436\u0438\u043c\u0435 GPIO.BOARD<\/strong><\/p>\n<pre><code class=\"python\">GPIO.setup(18, GPIO.OUT)<\/code><\/pre>\n<p><strong>\u0412 \u0440\u0435\u0436\u0438\u043c\u0435 GPIO.SUNXI<\/strong><\/p>\n<pre><code class=\"python\">GPIO.setup(\"PL3\", GPIO.OUT)<\/code><\/pre>\n<p><strong>\u0412 \u0440\u0435\u0436\u0438\u043c\u0435 GPIO.SOC\/GPIO.SYSFS<\/strong><\/p>\n<pre><code class=\"python\">GPIO.setup(355, GPIO.OUT)<\/code><\/pre>\n<p>\u0438\u043b\u0438<\/p>\n<pre><code class=\"python\">GPIO.setup(GPIO.PL+3, GPIO.OUT)<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 <strong>GPIO.SOC\/GPIO.SYSFS<\/strong><\/p>\n<p>\u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0438\u043d\u043e\u0432 \u0432 \u043e\u0434\u043d\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043f\u0438\u0441\u043a\u0438 (<strong>list<\/strong>)<\/p>\n<pre><code class=\"python\">GPIO.setup([GPIO.PL+3, GPIO.PA+10], GPIO.OUT)<\/code><\/pre>\n<p>\u0438\u043b\u0438 \u043a\u043e\u0440\u0442\u0435\u0436\u0438 (<strong>tuple<\/strong>)<\/p>\n<pre><code class=\"python\">GPIO.setup((GPIO.PL+3, GPIO.PA+10), GPIO.OUT)<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043f\u0438\u043d\u0430 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 OUT \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <strong>initial<\/strong>.<\/p>\n<p>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u0438\u043d \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 OUTPUT \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0435\u0434\u0438\u043d\u0438\u0446\u0430 GPIO.HIGH<\/p>\n<pre><code class=\"python\">GPIO.setup(355, GPIO.OUT, initial=GPIO.HIGH)<\/code><\/pre>\n<p>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u0438\u043d \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 OUTPUT \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043d\u043e\u043b\u044c GPIO.LOW<\/p>\n<pre><code class=\"python\">GPIO.setup(pin, GPIO.OUT, initial=GPIO.LOW)<\/code><\/pre>\n<p><a class=\"anchor\" name=\"522\" id=\"522\"><\/a><\/p>\n<h4>\u0420\u0435\u0436\u0438\u043c \u0447\u0442\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f (INPUT)<\/h4>\n<p><strong>\u0412 \u0440\u0435\u0436\u0438\u043c\u0435 GPIO.SOC\/GPIO.SYSFS<\/strong><\/p>\n<pre><code class=\"python\">GPIO.setup(GPIO.PL+3, GPIO.IN)<\/code><\/pre>\n<p>\u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0438\u043d\u043e\u0432 \u0432 \u043e\u0434\u043d\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043f\u0438\u0441\u043a\u0438 (<strong>list<\/strong>)<\/p>\n<pre><code class=\"python\">GPIO.setup([GPIO.PL+3, GPIO.PA+10], GPIO.IN)<\/code><\/pre>\n<p>\u0438\u043b\u0438 \u043a\u043e\u0440\u0442\u0435\u0436\u0438 (<strong>tuple<\/strong>)<\/p>\n<pre><code class=\"python\">GPIO.setup((GPIO.PL+3, GPIO.PA+10), GPIO.IN)<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0438\u043d\u0430 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 <strong>INPUT<\/strong>, \u043c\u043e\u0436\u043d\u043e \u0432 \u044d\u0442\u043e\u0439 \u0436\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u044c \u043f\u043e\u0432\u044b\u0448\u0430\u044e\u0449\u0443\u044e\/\u043f\u043e\u043d\u0438\u0436\u0430\u044e\u0449\u0443\u044e \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440\u043d\u0443\u044e \u043f\u043e\u0434\u0442\u044f\u0436\u043a\u0443 \u044d\u0442\u043e\u0433\u043e \u043f\u0438\u043d\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u043e\u0434\u0442\u044f\u0433\u0438\u0432\u0430\u043d\u0438\u0435.<\/p>\n<blockquote>\n<p><strong><em>\u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435:<\/em><\/strong> <em>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440\u043d\u043e\u0439 \u043f\u043e\u0434\u0442\u044f\u0436\u043a\u0438 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0438 \u043d\u0435\u0442, \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u044b, \u0432\u043c\u0435\u0441\u0442\u043e \u043d\u0438\u0445 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u043e \u0431\u044b\u043b\u043e \u0445\u043e\u0442\u044f \u0431\u044b \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e \u0441 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043a\u043e\u0434\u043e\u043c, \u043d\u043e \u0431\u0435\u0437 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/em><\/p>\n<p><em>\u0415\u0441\u043b\u0438 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043d\u0442\u0430\u043a\u0442 \u043d\u0438 \u043a \u0447\u0435\u043c\u0443 \u043d\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d, \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u00ab\u043f\u043b\u0430\u0432\u0430\u0442\u044c\u00bb. \u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d\u043e \u043d\u0438 \u0441 \u0447\u0435\u043c \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043e, \u043f\u043e\u043a\u0430 \u0432\u044b \u043d\u0435 \u043d\u0430\u0436\u043c\u0435\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044c.<\/em><\/p>\n<p><em>\u0427\u0442\u043e\u0431\u044b \u043e\u0431\u043e\u0439\u0442\u0438 \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u043e\u0434\u0442\u044f\u0433\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u0438\u043b\u0438 \u043f\u043e\u043d\u0438\u0436\u0430\u044e\u0449\u0438\u0439 \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0445\u043e\u0434\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u0420\u0435\u0437\u0438\u0441\u0442\u043e\u0440\u044b \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f\/\u043f\u043e\u043d\u0438\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f. \u0412 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e\u043c \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0438 \u043e\u0431\u044b\u0447\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440 10 \u043a\u041e\u043c \u043c\u0435\u0436\u0434\u0443 \u0432\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u0430\u043d\u0430\u043b\u043e\u043c \u0438 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435\u043c 3,3 \u0412 (\u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u0435) \u0438\u043b\u0438 0 \u0412 (\u043f\u043e\u043d\u0438\u0436\u0435\u043d\u0438\u0435).<\/em><\/p>\n<\/blockquote>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/224\/556\/029\/224556029365fc052dddebc9f50df258.png\" width=\"729\" height=\"326\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/224\/556\/029\/224556029365fc052dddebc9f50df258.png\"\/><\/figure>\n<p><strong><em>\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u0430\u044f \u043f\u043e\u0434\u0442\u044f\u0436\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f.<\/em><\/strong><\/p>\n<p>\u041f\u043e\u0434\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u043c \u043a +3.3\u0412<\/p>\n<pre><code class=\"python\">GPIO.setup(GPIO.PL+3, GPIO.IN, pull_up_down=GPIO.PUD_UP)<\/code><\/pre>\n<p>\u041f\u043e\u0434\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u043c \u043a 0\u0412<\/p>\n<pre><code class=\"python\">GPIO.setup(GPIO.PL+3, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)<\/code><\/pre>\n<p>\u041e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043f\u043e\u0434\u0442\u044f\u0433\u0438\u0432\u0430\u043d\u0438\u0435<\/p>\n<pre><code class=\"python\">GPIO.setup(GPIO.PL+3, GPIO.IN, pull_up_down=GPIO.PUD_OFF)<\/code><\/pre>\n<p><a class=\"anchor\" name=\"53\" id=\"53\"><\/a><\/p>\n<h4>\u0427\u0442\u0435\u043d\u0438\u0435 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439<\/h4>\n<p>\u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043f\u0438\u043d\u0430, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 <strong>INPUT<\/strong> (\u0440\u0435\u0436\u0438\u043c \u0447\u0442\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f) \u0438\u043b\u0438 <strong>OUTPUT<\/strong> (\u0440\u0435\u0436\u0438\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f) \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439<code> input(channel)<\/code>.<\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u043c\u0435\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <strong>channel<\/strong> \u043d\u043e\u043c\u0435\u0440 \u043f\u0438\u043d\u0430 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u0440\u0435\u0436\u0438\u043c\u043e\u043c \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u0438 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <strong>0\/GPIO.LOW\/False<\/strong> \u0438\u043b\u0438 <strong>1\/GPIO.HIGH\/True<\/strong><\/p>\n<pre><code class=\"python\">value=GPIO.input(GPIO.PL+3)<\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432 value \u0437\u0430\u043f\u0438\u0448\u0435\u0442\u0441\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0438\u043d\u0430 PL3, <strong>0\/GPIO.LOW\/False<\/strong> \u0438\u043b\u0438 <strong>1\/GPIO.HIGH\/True<\/strong>.<\/p>\n<p>\u0414\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043f\u0438\u043d\u0430, \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u0440\u0435\u0436\u0438\u043c <strong>OUTPUT<\/strong> (\u0440\u0435\u0436\u0438\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f) \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <code>output(channel, state)<\/code>.<\/p>\n<p><strong>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/strong><\/p>\n<ul>\n<li>\n<p><strong>channel<\/strong> &#8212; \u043d\u043e\u043c\u0435\u0440 \u043f\u0438\u043d\u0430, \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a (<strong>list<\/strong>) \u0438 \u043a\u043e\u0440\u0442\u0435\u0436\u0438 (<strong>tuple<\/strong>)<\/p>\n<\/li>\n<li>\n<p><strong>state<\/strong> &#8212; \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0438\u043d\u0430 0\/GPIO.LOW\/False \u0438\u043b\u0438 1\/GPIO.HIGH\/True, \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a (<strong>list<\/strong>) \u0438 \u043a\u043e\u0440\u0442\u0435\u0436\u0438 (<strong>tuple<\/strong>)<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"python\">GPIO.output(GPIO.PL+3, GPIO.HIGH)<\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 <strong>PL3<\/strong> \u0431\u044b\u043b \u0437\u0430\u0434\u0430\u043d \u0432\u044b\u0441\u043e\u043a\u0438\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c (<strong>1\/GPIO.HIGH\/True<\/strong>), \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430 \u043f\u0438\u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 +3,3\u0412.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u043f\u0438\u0441\u043a\u0430 (<strong>list<\/strong>)<\/p>\n<pre><code class=\"python\">GPIO.output([GPIO.PL+3, GPIO.PA+10], GPIO.HIGH)<\/code><\/pre>\n<p>\u0438\u043b\u0438 \u043a\u043e\u0440\u0442\u0435\u0436\u0430 (<strong>tuple<\/strong>)<\/p>\n<pre><code class=\"python\">GPIO.output((GPIO.PL+3, GPIO.PA+10), GPIO.HIGH)<\/code><\/pre>\n<p>\u0412 \u044d\u0442\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u043c\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 <strong>PL3<\/strong> \u0438 <strong>PA10<\/strong> \u0432\u044b\u0441\u043e\u043a\u0438\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c (<strong>1\/GPIO.HIGH\/True<\/strong>).<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0438\u043d\u0430 \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u0436\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a (<strong>list<\/strong>) \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439<\/p>\n<pre><code class=\"python\">GPIO.output([GPIO.PL+3, GPIO.PA+10], [GPIO.HIGH, GPIO.LOW])<\/code><\/pre>\n<p>\u0438\u043b\u0438 \u043a\u043e\u0440\u0442\u0435\u0436\u0430 (<strong>tuple<\/strong>)<\/p>\n<pre><code class=\"python\">GPIO.output([GPIO.PL+3, GPIO.PA+10], (GPIO.HIGH, GPIO.LOW))<\/code><\/pre>\n<p>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b <strong>channel<\/strong> \u0438 <strong>state<\/strong> \u043c\u043e\u0433\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u0442\u0438\u043f \u0441\u043f\u0438\u0441\u043e\u043a (<strong>list<\/strong>) \u0438\u043b\u0438 \u043a\u043e\u0440\u0442\u0435\u0436 (<strong>tuple<\/strong>), \u0441\u0432\u044f\u0437\u0438 \u0442\u0438\u043f\u043e\u0432 \u043d\u0435\u0442. \u041d\u043e \u0432 state \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c 1 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0434\u0430\u043d\u043e \u0432\u0441\u0435 \u043f\u0438\u043d\u0430 \u0438\u043b\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441 <strong>channel<\/strong>.<\/p>\n<p>\u0418 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>cleanup()<\/code>, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u0443\u044e \u0434\u043b\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 \u043f\u0438\u043d\u043e\u0432 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435.<\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u043c\u0435\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <strong>channel<\/strong> \u043d\u043e\u043c\u0435\u0440 \u043f\u0438\u043d\u0430 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u0440\u0435\u0436\u0438\u043c\u043e\u043c \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0421\u0431\u0440\u043e\u0441 \u0432\u0441\u0435\u0445 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0438\u043d\u043e\u0432<\/p>\n<pre><code class=\"python\">GPIO.cleanup()<\/code><\/pre>\n<blockquote>\n<p><strong><em>\u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435:<\/em><\/strong> <em>\u041f\u0440\u0438 \u0442\u0430\u043a\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435 \u0442\u0430\u043a\u0436\u0435 \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u0441\u044f \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0438\u043d\u043e\u0432.<\/em><\/p>\n<\/blockquote>\n<p>\u0421\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u043f\u0438\u043d<\/p>\n<pre><code class=\"python\">GPIO.cleanup(GPIO.PL+3)<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a (<strong>list<\/strong>) \u0438\u043b\u0438 \u043a\u043e\u0440\u0442\u0435\u0436 (<strong>tuple<\/strong>), \u0447\u0442\u043e\u0431\u044b \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0438\u043d\u043e\u0432<\/p>\n<pre><code class=\"python\">GPIO.cleanup([GPIO.PL+3, GPIO.PA+10])<\/code><\/pre>\n<p>\u0438\u043b\u0438<\/p>\n<pre><code class=\"python\">GPIO.cleanup((GPIO.PL+3, GPIO.PA+10))<\/code><\/pre>\n<pre><code class=\"python\"><\/code><\/pre>\n<p><a class=\"anchor\" name=\"6\" id=\"6\"><\/a><\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438<\/h3>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043d\u0430\u0447\u0430\u043b\u0438 \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 RepkaPi.GPIO SysFS \u0434\u043b\u044f Python3, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443, \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438 \u0435\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 GPIO \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 I\/O (Input\/Output).<\/p>\n<p><strong><em>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435!<\/em><\/strong><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/articles\/757522\/\"> https:\/\/habr.com\/ru\/articles\/757522\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h3>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435<\/h3>\n<ol>\n<li>\n<p><a href=\"#1\" rel=\"noopener noreferrer nofollow\">\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#2\" rel=\"noopener noreferrer nofollow\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#3\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#4\" rel=\"noopener noreferrer nofollow\">\u041c\u0435\u0442\u043e\u0434\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#5\" rel=\"noopener noreferrer nofollow\">\u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439<\/a><\/p>\n<ol>\n<li>\n<p><a href=\"#51\" rel=\"noopener noreferrer nofollow\">\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u043f\u043b\u0430\u0442\u0435<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#52\" rel=\"noopener noreferrer nofollow\">\u0420\u0435\u0436\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0438\u043d\u043e\u0432<\/a><\/p>\n<ol>\n<li>\n<p><a href=\"#521\" rel=\"noopener noreferrer nofollow\">\u0420\u0435\u0436\u0438\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f (OUTPUT)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#522\" rel=\"noopener noreferrer nofollow\">\u0420\u0435\u0436\u0438\u043c \u0447\u0442\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f (INPUT)<\/a><\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p><a href=\"#53\" rel=\"noopener noreferrer nofollow\">\u0427\u0442\u0435\u043d\u0438\u0435 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439<\/a><\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p><a href=\"#6\" rel=\"noopener noreferrer nofollow\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/a><\/p>\n<\/li>\n<\/ol>\n<p><a class=\"anchor\" name=\"1\" id=\"1\"><\/a><\/p>\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<figure class=\"full-width\"><\/figure>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 RepkaPi.GPIO, \u0434\u0430\u043d\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0430 Python 3 \u0438 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f GPIO \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043c\u0435\u0442\u043e\u0434\u044b, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 SysFS. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0439 \u043f\u0440\u043e SysFS \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0430 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/Sysfs\" rel=\"noopener noreferrer nofollow\">wikipedia<\/a>.<\/p>\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0431\u044b\u043b\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 RPI.GPIO \u0434\u043b\u044f Raspberry Pi \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u0412\u0430\u0448\u0438\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432.<\/p>\n<p>\u041f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430 gitflic.ru: <a href=\"https:\/\/gitflic.ru\/project\/repka_pi\/repkapigpiofs\" rel=\"noopener noreferrer nofollow\">https:\/\/gitflic.ru\/project\/repka_pi\/repkapigpiofs<\/a>.<\/p>\n<p><a class=\"anchor\" name=\"2\" id=\"2\"><\/a><\/p>\n<h3>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430<\/h3>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b.<\/p>\n<p>\u041e\u0431\u043d\u043e\u0432\u0438\u043c \u0438\u043d\u0434\u0435\u043a\u0441 \u043f\u0430\u043a\u0435\u0442\u043e\u0432<\/p>\n<pre><code class=\"bash\">sudo apt-get update<\/code><\/pre>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b<\/p>\n<pre><code class=\"bash\">sudo apt-get install python3-dev python3-setuptools git<\/code><\/pre>\n<p>\u041a\u043b\u043e\u043d\u0438\u0440\u0443\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/p>\n<pre><code class=\"bash\">git clone https:\/\/gitflic.ru\/project\/repka_pi\/repkapigpiofs.git<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443<\/p>\n<pre><code class=\"bash\">cd repkapigpiofs<\/code><\/pre>\n<p>* \u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0430\u0440\u0445\u0438\u0432\u043e\u043c \u0441 gitflic \u0438 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u0430\u0442\u044c \u0432 \u0443\u0434\u043e\u0431\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0443\u044e \u0435\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443. \u041c\u043e\u0434\u0443\u043b\u044c \u0438\u043c\u0435\u0435\u0442 \u0434\u0432\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b, \u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 <strong>RepkaPi\/constants.py<\/strong><\/p>\n<ul>\n<li>\n<p><strong>GPIO.DEFAULTBOARD<\/strong> &#8212; \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c Repka Pi \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u044c. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 None. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u043b\u0430\u0442\u0443 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439. \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 GPIO.REPKAPI3 \u0438\u043b\u0438 1, \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u0447\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 Repka Pi 3 \u0438 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e \u043f\u043b\u0430\u0442\u044b \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e.<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.AUTODETECT<\/strong> &#8212; \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 Repka Pi. \u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 True\/False, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u0432 True. \u0415\u0441\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e True \u0442\u043e <strong>GPIO.DEFAULTBOARD<\/strong> \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f.<\/p>\n<\/li>\n<\/ul>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/p>\n<pre><code class=\"bash\">sudo python3 setup.py install<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a\u0430\u044f \u043a\u043e\u043d\u0446\u043e\u0432\u043a\u0430 \u0432\u044b\u0432\u043e\u0434\u0430<\/p>\n<figure class=\"full-width\"><\/figure>\n<h4>\u0411\u0435\u0437 root-\u0434\u043e\u0441\u0442\u0443\u043f\u0430<\/h4>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0431\u0435\u0437 \u043f\u043e\u043b\u043d\u043e\u043c\u043e\u0447\u0438\u0439 root, \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e UDEV, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u0430\u043c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0433\u0440\u0443\u043f\u043f\u0443 gpio<\/p>\n<pre><code class=\"bash\">sudo groupadd gpio<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0433\u0440\u0443\u043f\u043f\u0443 gpio<\/p>\n<pre><code class=\"bash\">sudo usermod -aG gpio &lt;\u0432\u0430\u0448 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c><\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0434\u043b\u044f udev \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/p>\n<pre><code class=\"bash\">sudo nano \/etc\/udev\/rules.d\/99-gpio.rules<\/code><\/pre>\n<p>\u0412 \u043e\u0442\u043a\u0440\u044b\u0432\u0448\u0435\u0439\u0441\u044f \u0444\u0430\u0439\u043b \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435<\/p>\n<pre><code class=\"bash\">KERNEL==\"gpio\\*\", MODE:=\"0660\", GROUP:=\"gpio\"   KERNEL==\"pwm*\", MODE:=\"0660\", GROUP:=\"gpio\"   KERNEL==\"gpiochip*\", MODE:=\"0660\", GROUP:=\"gpio\"   SUBSYSTEM==\"gpio*\", PROGRAM=\"\/bin\/sh -c 'chown -R root:gpio \/sys\/class\/gpio &amp;&amp; chmod -R 777 \/sys\/class\/gpio &amp;&amp; chown -R root:gpio \/sys\/class\/gpio\/* &amp;&amp; chmod -R 777 \/sys\/class\/gpio\/* &amp;&amp; chown -R root:gpio \/sys\/devices\/platform\/soc\/*.pinctrl\/gpio &amp;&amp; chmod -R 777 \/sys\/devices\/platform\/soc\/*.pinctrl\/gpio'\" SUBSYSTEM==\"pwm*\", PROGRAM=\"\/bin\/sh -c 'chown -R root:gpio \/sys\/class\/pwm &amp;&amp; chmod -R 777 \/sys\/class\/pwm &amp;&amp; chown -R root:gpio \/sys\/class\/pwm\/* &amp;&amp; chmod -R 777 \/sys\/class\/pwm\/* &amp;&amp; chown -R root:gpio \/sys\/class\/pwm\/pwmchip0\/* &amp;&amp; chmod -R 777 \/sys\/class\/pwm\/pwmchip0\/* &amp;&amp; chown -R root:gpio \/sys\/devices\/platform\/soc\/*.pwm\/pwm &amp;&amp; chmod -R 777 \/sys\/devices\/platform\/soc\/*.pwm\/pwm '\"<\/code><\/pre>\n<p>\u041d\u0430\u0436\u043c\u0438\u0442\u0435 <code>ctrl-x<\/code>, <code>Y<\/code> \u0438 <code>ENTER<\/code>, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0444\u0430\u0439\u043b.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0443<\/p>\n<pre><code class=\"bash\">sudo reboot<\/code><\/pre>\n<p><a class=\"anchor\" name=\"3\" id=\"3\"><\/a><\/p>\n<h3>\u041a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/h3>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0438\u043c\u0435\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0438 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0438\u0445 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0439.<\/p>\n<h4>\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435<\/h4>\n<ul>\n<li>\n<p><strong>GPIO.RPI_INFO<\/strong> &#8212; \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.VERSION<\/strong> &#8212; \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0432\u0435\u0440\u0441\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/p>\n<\/li>\n<\/ul>\n<h4>\u041c\u043e\u0434\u0435\u043b\u0438 Repka Pi (board)<\/h4>\n<ul>\n<li>\n<p><strong>GPIO.REPKAPI3<\/strong> &#8212; Repka Pi 3<\/p>\n<\/li>\n<\/ul>\n<h4>\u0420\u0435\u0436\u0438\u043c\u044b \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u044f \u043f\u0438\u043d\u043e\u0432 (mode)<\/h4>\n<ul>\n<li>\n<p><strong>GPIO.BOARD<\/strong> &#8212; 10 &#8212; \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u044f \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443 \u043e\u0442 1 \u0434\u043e 40<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.BCM<\/strong> &#8212; 11 &#8212; \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u044f \u043f\u043e Raspberry Pi 3B \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u0432 \u043d\u043e\u0432\u044b\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.SUNXI<\/strong> &#8212; 12 &#8212; \u043f\u043e \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u043c\u0443 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0435\u044e SUNXI \u201cPA0\u2026, PC\u2026, PL\u2026\u201d<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.SOC<\/strong> &#8212; 13 &#8212; \u043f\u043e \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443 \u0432 SOC, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0432 SysFS, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043d\u043e \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.SYSFS<\/strong> &#8212; \u0430\u043b\u044c\u044f\u0441 \u0434\u043b\u044f <strong>GPIO.SOC<\/strong><\/p>\n<\/li>\n<\/ul>\n<h4>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f SUNXI<\/h4>\n<ul>\n<li>\n<p><strong>GPIO.PA<\/strong> &#8212; 0<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.PC<\/strong> &#8212; 64<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.PD<\/strong> &#8212; 96<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.PE<\/strong> &#8212; 128<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.PF<\/strong> &#8212; 160<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.PG<\/strong> &#8212; 192<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.PL<\/strong> &#8212; 352<\/p>\n<\/li>\n<\/ul>\n<h4>\u0420\u0435\u0436\u0438\u043c\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0438\u043d\u0430<\/h4>\n<ul>\n<li>\n<p><strong>GPIO.IN<\/strong> &#8212; 1 &#8212; \u0440\u0435\u0436\u0438\u043c <strong>INPUT<\/strong> &#8212; \u0447\u0442\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.OUT<\/strong> &#8212; 0 &#8212; \u0440\u0435\u0436\u0438\u043c <strong>OUTPUT<\/strong> &#8212; \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f<\/p>\n<\/li>\n<\/ul>\n<h4>\u0421\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0438\u043d\u0430<\/h4>\n<ul>\n<li>\n<p><strong>GPIO.HIGH<\/strong> &#8212; 1 &#8212; \u0432\u044b\u0441\u043e\u043a\u0438\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c, \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0435\u0434\u0438\u043d\u0438\u0446\u0430<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.LOW<\/strong> &#8212; 0 &#8212; \u043d\u0438\u0437\u043a\u0438\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c, \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043d\u043e\u043b\u044c<\/p>\n<\/li>\n<\/ul>\n<h4>\u041f\u043e\u0434\u0442\u044f\u0436\u043a\u0430 \u043f\u0438\u043d\u0430<\/h4>\n<ul>\n<li>\n<p><strong>GPIO.PUD_OFF<\/strong> &#8212; \u043d\u0435 \u043f\u043e\u0434\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u0442\u0441\u044f<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.PUD_DOWN<\/strong> &#8212; \u043f\u0438\u043d \u0447\u0435\u0440\u0435\u0437 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u043a 0 (GND)<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.PUD_UP<\/strong> &#8212; \u043f\u0438\u043d \u0447\u0435\u0440\u0435\u0437 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u043a +3.3\u0412<\/p>\n<\/li>\n<\/ul>\n<blockquote>\n<p><strong><em>\u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435:<\/em><\/strong> <em>\u041f\u043e\u0434\u0442\u044f\u0436\u043a\u0430 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043f\u043e\u0434\u0442\u044f\u0436\u043a\u0443 \u0447\u0435\u0440\u0435\u0437 \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440.<\/em><\/p>\n<\/blockquote>\n<h4>\u0421\u043e\u0431\u044b\u0442\u0438\u0439\u043d\u044b\u0435<\/h4>\n<ul>\n<li>\n<p><strong>GPIO.RISING<\/strong> &#8212; \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u0441 LOW \u043d\u0430 HIGH<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.FALLING<\/strong> &#8212; \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u0441 HIGH \u043d\u0430 LOW<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.BOTH<\/strong> &#8212; \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u0432 \u043b\u044e\u0431\u043e\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435<\/p>\n<\/li>\n<\/ul>\n<p><a class=\"anchor\" name=\"4\" id=\"4\"><\/a><\/p>\n<h3>\u041c\u0435\u0442\u043e\u0434\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/h3>\n<h4>\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435<\/h4>\n<ul>\n<li>\n<p><strong>GPIO.getboardmodel()<\/strong> &#8212; \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c Repka Pi<\/p>\n<\/li>\n<li>\n<p><strong>GPIO.getmode()<\/strong> &#8212; \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u043e\u043c\u0435\u0440 \u0440\u0435\u0436\u0438\u043c\u0430 \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0438\u043d\u043e\u0432<\/p>\n<\/li>\n<\/ul>\n<h4>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u0447\u043d\u044b\u0435<\/h4>\n<ul>\n<li>\n<p><strong>GPIO.setboard()<\/strong> &#8212; \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 Repka Pi, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/p>\n<ul>\n<li>\n<p><strong>board<\/strong> &#8212; GPIO.REPKAPI3<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>GPIO.setmode()<\/strong> &#8212; \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0440\u0435\u0436\u0438\u043c\u0430 \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0438\u043d\u043e\u0432, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/p>\n<ul>\n<li>\n<p><strong>mode<\/strong> &#8212; GPIO.BOARD, GPIO.BCM, GPIO.SUNXI \u0438\u043b\u0438 GPIO.SOC<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>GPIO.setwarnings()<\/strong> &#8212; \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f\u043c\u0438, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 True\/False<\/p>\n<\/li>\n<\/ul>\n<h4>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 GPIO<\/h4>\n<ul>\n<li>\n<p><strong>GPIO.setup()<\/strong> &#8212; \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0438\u043d\u0430, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f<\/p>\n<ul>\n<li>\n<p><strong>channel<\/strong> &#8212; \u043d\u043e\u043c\u0435\u0440 \u043f\u0438\u043d\u0430 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u0440\u0435\u0436\u0438\u043c\u043e\u043c \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u0438,<\/p>\n<\/li>\n<li>\n<p><strong>direction<\/strong> &#8212; \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c GPIO \u043f\u0438\u043d \u043a\u0430\u043a \u0432\u0445\u043e\u0434 \u0438\u043b\u0438 \u0432\u044b\u0445\u043e\u0434 (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e GPIO.IN \u0438\u043b\u0438 GPIO.OUT)<\/p>\n<\/li>\n<li>\n<p><strong>initial<\/strong> &#8212; (\u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e) \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0438\u043d\u0430 (GPIO.LOW (0) \u0438\u043b\u0438 GPIO.HIGH (1),<\/p>\n<\/li>\n<li>\n<p><strong>pull_up_down<\/strong> &#8212; (\u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e) \u043f\u043e\u0434\u0442\u044f\u0436\u043a\u0430 \u043a +3,3\u0412 (GPIO.PUD_UP), \u043a 0 (GPIO.PUD_DOWN) \u0438\u043b\u0438 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d (GPIO.PUD_OFF).<\/p>\n<blockquote>\n<p><strong><em>\u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435<\/em><\/strong>: <em>\u041f\u043e\u0434\u0442\u044f\u0436\u043a\u0430 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043e \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438<\/em><\/p>\n<\/blockquote>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>GPIO.input()<\/strong> &#8212; \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0438\u043d\u0430, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/p>\n<ul>\n<li>\n<p><strong>channel<\/strong> &#8212; \u043d\u043e\u043c\u0435\u0440 \u043f\u0438\u043d\u0430 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u0440\u0435\u0436\u0438\u043c\u043e\u043c \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u0438, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 GPIO.LOW (0) \u0438\u043b\u0438 GPIO.HIGH (1)<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>GPIO.output()<\/strong> &#8212; \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0438\u043d\u0430, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f<\/p>\n<ul>\n<li>\n<p><strong>channel<\/strong> &#8212; \u043d\u043e\u043c\u0435\u0440 \u043f\u0438\u043d\u0430 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u0440\u0435\u0436\u0438\u043c\u043e\u043c \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u0438,<\/p>\n<\/li>\n<li>\n<p><strong>state<\/strong> &#8212; \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0438\u043d\u0430 GPIO.LOW (0) \u0438\u043b\u0438 GPIO.HIGH (1)<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>GPIO.cleanup()<\/strong> &#8212; \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043f\u0438\u043d\u044b \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/p>\n<ul>\n<li>\n<p><strong>channel<\/strong> &#8212; \u043d\u043e\u043c\u0435\u0440 \u043f\u0438\u043d\u0430 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u0440\u0435\u0436\u0438\u043c\u043e\u043c \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 None (\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e) \u0447\u0442\u043e\u0431\u044b \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0432\u0441\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u0438\u043d\u044b<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong><em>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.<\/em><\/strong><\/p>\n<p><a class=\"anchor\" name=\"5\" id=\"5\"><\/a><\/p>\n<h3>\u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439<\/h3>\n<p> \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 RepkaPi.GPIO \u0432 \u0432\u0430\u0448\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u0435  <\/p>\n<pre><code class=\"python\">import RepkaPi.GPIO as GPIO<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0432\u044b \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043b\u0438 <strong>GPIO.DEFAULTBOARD<\/strong> \u0438 <strong>GPIO.AUTODETECT<\/strong> \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u0432 False \u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c Repka Pi, \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439<\/p>\n<pre><code class=\"python\">GPIO.setboard(GPIO.REPKAPI3)<\/code><\/pre>\n<p><strong>GPIO.REPKAPI3<\/strong> &#8212; \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0447\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0430 Repka Pi 3. \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c.<\/p>\n<p>\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u0430\u043a\u043e\u0439 \u043c\u044b \u0440\u0435\u0436\u0438\u043c \u0445\u043e\u0442\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c<\/p>\n<pre><code class=\"python\">GPIO.setmode(GPIO.SOC)<\/code><\/pre>\n<p>\u0412\u044b\u0448\u0435 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u201c<a href=\"#3\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/a>\u201d \u0431\u044b\u043b\u0438 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u044b \u0432\u0441\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0439 \u0447\u0435\u043c \u043e\u043d\u0438 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f.<\/p>\n<p><strong>BOARD<\/strong> &#8212; \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u0432\u043e\u043c\u0443 \u043d\u043e\u043c\u0435\u0440\u0443 \u043f\u0438\u043d\u0430 \u043d\u0430 \u043f\u043b\u0430\u0442\u0435, \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u043c \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u043f\u0438\u043d\u0443 \u043f\u043e\u0434 \u21167, \u0442\u043e \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043d\u0443\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u043e\u0436\u0435 7<\/p>\n<figure class=\"\"><\/figure>\n<p><strong>SUNXI<\/strong> &#8212;\u00a0 \u041e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043f\u043e \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u043c\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0443 \u0432 \u0441\u0445\u0435\u043c\u0435 \u0440\u0430\u0441\u043f\u0438\u043d\u043e\u0432\u043a\u0438, \u0435\u0441\u043b\u0438 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u044d\u0442\u043e\u0442 \u0440\u0435\u0436\u0438\u043c, \u0442\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u043f\u0438\u043d\u0443 7 \u0431\u0443\u0434\u0435\u0442 \u043a\u0430\u043a \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u201c<strong>PA7<\/strong>\u201d<\/p>\n<figure class=\"\"><\/figure>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c, \u043d\u043e \u0442\u043e\u0436\u0435 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p><strong>SOC \u0438 SYSFS<\/strong> &#8212; \u0447\u0438\u0441\u043b\u043e\u0432\u0430\u044f \u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u044f \u043f\u043e SOC \u0438 SYSFS \u0442.\u0435. \u0435\u0441\u043b\u0438 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0440\u0430\u0441\u043f\u0438\u043d\u043e\u0432\u043a\u0443 \u043a\u0430\u043a \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e, \u0442\u0430\u043a \u0438 \u043d\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0432 \u0441\u0442\u0430\u0442\u044c\u0435, \u0442\u043e \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446.<\/p>\n<figure class=\"\"><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0437\u0430\u0445\u043e\u0442\u0438\u0442\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u043f\u0438\u043d\u0443 \u043f\u043e\u0434 \u043d\u043e\u043c\u0435\u0440\u043e\u043c 18, \u0442\u043e \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0435\u0433\u043e \u043d\u043e\u043c\u0435\u0440 SOC\/SysFS \u0440\u0430\u0432\u043d\u044b\u0439 355, \u0442\u0430\u043a\u0436\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043f\u043e SUNX (P \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 Pin \u0435\u0435 \u043c\u044b \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c. \u0424\u043e\u0440\u043c\u0443\u043b\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f, (\u043f\u043e\u0440\u044f\u0434\u043a\u043e\u0432\u044b\u0439 \u043d\u043e\u043c\u0435\u0440 \u043b\u0430\u0442\u0438\u043d\u0441\u043a\u043e\u0439 \u0431\u0443\u043a\u0432\u0430 (L) &#8212; 1) <em>32 + \u043d\u043e\u043c\u0435\u0440 \u043f\u043e\u0441\u043b\u0435 \u043b\u0430\u0442\u0438\u043d\u0441\u043a\u043e\u0439 \u0431\u0443\u043a\u0432\u0430 (3), \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c (12-1)<\/em> 32+3=355).<\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0442.\u043a. \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f. \u0422\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0435\u0441\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b.<\/p>\n<p><strong>PA<\/strong> &#8212; 0, <strong>PC<\/strong> &#8212; 64, <strong>PD<\/strong> &#8212; 96, <strong>PE<\/strong> &#8212; 128, <strong>PF<\/strong> &#8212; 160, <strong>PG<\/strong> &#8212; 192, <strong>PL<\/strong> &#8212; 352 \u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a 18 \u043f\u0438\u043d\u0443 PL3 \u0431\u0443\u0434\u0435\u0442 \u0443\u0436\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c <strong>GPIO.PL<\/strong> + 3.<\/p>\n<p><strong>BCM<\/strong> &#8212; \u044d\u0442\u0430 \u0441\u0445\u0435\u043c\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0434\u043b\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c \u043f\u043e <strong>BCM<\/strong> \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430\u043c \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0432 Raspberry Pi. \u0415\u0441\u043b\u0438 \u043c\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0441\u0445\u0435\u043c\u0443 Raspberry Pi \u0442\u043e \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u043d\u0430 7 \u043f\u0438\u043d\u0435 \u0443 \u043d\u0435\u0433\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f GPIO4.<\/p>\n<p>\u041e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u043d\u043e\u043c\u0435\u0440\u0443 GPIO \u0442.\u0435. 4, \u0434\u0430\u043b\u044c\u0448\u0435 \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u0434\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u043a Repka Pi, \u0442.\u0435. \u043f\u043e <strong>SOC<\/strong> \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 7 \u0438\u043b\u0438 PA7 \u043f\u043e <strong>SUNXI<\/strong><\/p>\n<figure class=\"\"><\/figure>\n<p><strong><em>\u0420\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0441\u0442\u0430\u0442\u044c\u0438 \u044d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0435 \u0431\u0443\u0434\u0435\u043c, \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0430 Repka Pi \u043e\u043d \u043d\u0435 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f.<\/em><\/strong><\/p>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c, \u0442\u043e \u043d\u0435 \u043f\u0435\u0440\u0435\u0436\u0438\u0432\u0430\u0439\u0442\u0435 \u043c\u044b \u0435\u0449\u0435 \u0431\u0443\u0434\u0435\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445, \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0440\u0430\u0437.<\/p>\n<p>\u0418 \u0442\u0430\u043a \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0432\u043e \u0432\u0441\u0435\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445, \u043d\u0430\u0437\u043e\u0432\u0435\u043c \u0438\u0445 \u0431\u0430\u0437\u043e\u0432\u044b\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438.<\/p>\n<p><a class=\"anchor\" name=\"51\" id=\"51\"><\/a><\/p>\n<h4>\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u043f\u043b\u0430\u0442\u0435<\/h4>\n<p>\u0412 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0435\u0441\u0442\u044c \u0434\u0432\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0438 \u043e\u0434\u0438\u043d \u043c\u0435\u0442\u043e\u0434 \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u043b\u0430\u0442\u0435 \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043b\u0430\u0442\u044b<\/p>\n<pre><code class=\"python\">GPIO.getboardmodel()<\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0432\u0435\u0440\u043d\u0435\u0442 \u043d\u0430\u043c<\/p>\n<pre><code class=\"bash\">Repka Pi 3<\/code><\/pre>\n<p>* \u043f\u0440\u0438 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u0438 \u043f\u043e \u043c\u0435\u0440\u0435 \u0438\u0445 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u0442\u0432\u0435\u0442\u044b.<\/p>\n<p>\u0412\u0435\u0440\u0441\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/p>\n<pre><code class=\"python\">GPIO.VERSION<\/code><\/pre>\n<p>\u0412\u0435\u0440\u043d\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u0441\u0438\u044f <code>0.1.2<\/code>, \u044d\u0442\u043e \u0432\u0435\u0440\u0441\u0438\u044f \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<p>\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435<\/p>\n<pre><code class=\"python\">GPIO.RPI_INFO<\/code><\/pre>\n<p>\u0412\u0435\u0440\u043d\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432<\/p>\n<pre><code>{'P1_REVISION': 3, 'TYPE': 'Repka Pi 3', 'MANUFACTURER': '\u0418\u041d\u0422\u0415\u041b\u041b\u0415\u041a\u0422', 'RAM': '1GB', 'REVISION': '', 'PROCESSOR': 'Allwinner H5'}<\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0432 RPI.GPIO \u0434\u043b\u044f Raspberry Pi.<\/p>\n<p>\u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043c\u043e\u0436\u043d\u043e, \u043e\u0431\u0440\u0430\u0442\u0438\u0432\u0448\u0438\u0441\u044c \u043a \u043d\u0435\u043c\u0443 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e:<\/p>\n<pre><code class=\"python\">GPIO.RPI_INFO['MANUFACTURER']<\/code><\/pre>\n<p>\u0412\u0435\u0440\u043d\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/p>\n<pre><code>\u0418\u041d\u0422\u0415\u041b\u041b\u0415\u041a\u0422<\/code><\/pre>\n<pre><code class=\"python\">GPIO.RPI_INFO['PROCESSOR']<\/code><\/pre>\n<p>\u0412\u0435\u0440\u043d\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/p>\n<pre><code>Allwinner H5<\/code><\/pre>\n<p>\u0423\u0437\u043d\u0430\u0442\u044c, \u043a\u0430\u043a\u043e\u0439 \u0440\u0435\u0436\u0438\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d<\/p>\n<pre><code class=\"python\">GPIO.getmode()<\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0432\u0435\u0440\u043d\u0435\u0442 \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u043c\u0443  \u0440\u0435\u0436\u0438\u043c\u0443 \u0438\u043b\u0438 None. \u0414\u0430\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442.<\/p>\n<p><a class=\"anchor\" name=\"52\" id=\"52\"><\/a><\/p>\n<h4>\u0420\u0435\u0436\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0438\u043d\u043e\u0432<\/h4>\n<p>\u041f\u043e\u0441\u043b\u0435 <\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-353431","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/353431","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=353431"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/353431\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=353431"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=353431"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=353431"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}