{"id":965,"date":"2024-06-05T09:40:33","date_gmt":"2024-06-05T06:40:33","guid":{"rendered":"http:\/\/rantivi.ru\/?p=965"},"modified":"2024-06-05T15:35:32","modified_gmt":"2024-06-05T12:35:32","slug":"%d0%b4%d0%b0%d1%82%d1%87%d0%b8%d0%ba-%d1%82%d0%b5%d0%bc%d0%bf%d0%b5%d1%80%d0%b0%d1%82%d1%83%d1%80%d1%8b-%d0%b8-%d0%b2%d0%bb%d0%b0%d0%b6%d0%bd%d0%be%d1%81%d1%82%d0%b8-%d0%bd%d0%b0-raspberry-pi","status":"publish","type":"post","link":"https:\/\/rantivi.ru\/?p=965","title":{"rendered":"\u0414\u0430\u0442\u0447\u0438\u043a \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u0438 \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 Raspberry Pi"},"content":{"rendered":"\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b:<\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Raspberry pi<\/li>\n\n\n\n<li>\u0414\u0430\u0442\u0447\u0438\u043a SHT31-D<\/li>\n\n\n\n<li>\u041f\u0440\u043e\u0432\u043e\u0434\u0430<\/li>\n<\/ul>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>\u0420\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u044d\u0442\u043e \u0432\u0441\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e \u0448\u0438\u043d\u0435 I2C, \u0432\u043a\u043b\u044e\u0447\u0438\u043c \u0435\u0451<\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b -&gt; Raspberry Pi Configuration -&gt; <\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"http:\/\/rantivi.ru\/wp-content\/uploads\/2024\/06\/image-1024x768.png\" alt=\"\" class=\"wp-image-966\" style=\"width:620px;height:auto\" srcset=\"https:\/\/rantivi.ru\/wp-content\/uploads\/2024\/06\/image-1024x768.png 1024w, https:\/\/rantivi.ru\/wp-content\/uploads\/2024\/06\/image-300x225.png 300w, https:\/\/rantivi.ru\/wp-content\/uploads\/2024\/06\/image-768x576.png 768w, https:\/\/rantivi.ru\/wp-content\/uploads\/2024\/06\/image.png 1026w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>interfaces -&gt; I2C -&gt; \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"539\" height=\"418\" src=\"http:\/\/rantivi.ru\/wp-content\/uploads\/2024\/06\/image-1.png\" alt=\"\" class=\"wp-image-967\" srcset=\"https:\/\/rantivi.ru\/wp-content\/uploads\/2024\/06\/image-1.png 539w, https:\/\/rantivi.ru\/wp-content\/uploads\/2024\/06\/image-1-300x233.png 300w\" sizes=\"auto, (max-width: 539px) 100vw, 539px\" \/><\/figure>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>\u0427\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u044c :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo raspi-<strong>config<\/strong><\/code><\/pre>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"641\" height=\"339\" src=\"http:\/\/rantivi.ru\/wp-content\/uploads\/2024\/06\/image-2.png\" alt=\"\" class=\"wp-image-970\" srcset=\"https:\/\/rantivi.ru\/wp-content\/uploads\/2024\/06\/image-2.png 641w, https:\/\/rantivi.ru\/wp-content\/uploads\/2024\/06\/image-2-300x159.png 300w\" sizes=\"auto, (max-width: 641px) 100vw, 641px\" \/><\/figure>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"637\" height=\"380\" src=\"http:\/\/rantivi.ru\/wp-content\/uploads\/2024\/06\/image-3.png\" alt=\"\" class=\"wp-image-971\" srcset=\"https:\/\/rantivi.ru\/wp-content\/uploads\/2024\/06\/image-3.png 637w, https:\/\/rantivi.ru\/wp-content\/uploads\/2024\/06\/image-3-300x179.png 300w\" sizes=\"auto, (max-width: 637px) 100vw, 637px\" \/><\/figure>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"637\" height=\"387\" src=\"http:\/\/rantivi.ru\/wp-content\/uploads\/2024\/06\/image-4.png\" alt=\"\" class=\"wp-image-972\" srcset=\"https:\/\/rantivi.ru\/wp-content\/uploads\/2024\/06\/image-4.png 637w, https:\/\/rantivi.ru\/wp-content\/uploads\/2024\/06\/image-4-300x182.png 300w\" sizes=\"auto, (max-width: 637px) 100vw, 637px\" \/><\/figure>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0434\u0430\u0442\u0447\u0438\u043a \u043a GPIO Raspberry Pi:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"894\" height=\"1024\" src=\"http:\/\/rantivi.ru\/wp-content\/uploads\/2024\/06\/wiring-894x1024.png\" alt=\"\" class=\"wp-image-976\" srcset=\"https:\/\/rantivi.ru\/wp-content\/uploads\/2024\/06\/wiring-894x1024.png 894w, https:\/\/rantivi.ru\/wp-content\/uploads\/2024\/06\/wiring-262x300.png 262w, https:\/\/rantivi.ru\/wp-content\/uploads\/2024\/06\/wiring-768x879.png 768w, https:\/\/rantivi.ru\/wp-content\/uploads\/2024\/06\/wiring.png 918w\" sizes=\"auto, (max-width: 894px) 100vw, 894px\" \/><\/figure>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u0442\u0447\u0438\u043a\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c :<\/p>\n\n\n\n<p>\u0423\u0442\u0438\u043b\u0438\u0442\u0430 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0438\u0434 \u0434\u0430\u0442\u0447\u0438\u043a\u0430<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get install -y i2c-tools<\/code><\/pre>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>\u0423\u0437\u043d\u0430\u0435\u043c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443 \u043d\u0430\u0441 I2C \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u043e\u0432:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>i2cdetect -l<\/code><\/pre>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"649\" height=\"79\" src=\"http:\/\/rantivi.ru\/wp-content\/uploads\/2024\/06\/image-6.png\" alt=\"\" class=\"wp-image-978\" srcset=\"https:\/\/rantivi.ru\/wp-content\/uploads\/2024\/06\/image-6.png 649w, https:\/\/rantivi.ru\/wp-content\/uploads\/2024\/06\/image-6-300x37.png 300w\" sizes=\"auto, (max-width: 649px) 100vw, 649px\" \/><\/figure>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u0442\u0447\u0438\u043a\u0438:<\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>i2cdetect -y 1<\/code><\/pre>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"449\" height=\"248\" src=\"http:\/\/rantivi.ru\/wp-content\/uploads\/2024\/06\/image-7.png\" alt=\"\" class=\"wp-image-979\" srcset=\"https:\/\/rantivi.ru\/wp-content\/uploads\/2024\/06\/image-7.png 449w, https:\/\/rantivi.ru\/wp-content\/uploads\/2024\/06\/image-7-300x166.png 300w\" sizes=\"auto, (max-width: 449px) 100vw, 449px\" \/><\/figure>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip3 install adafruit-circuitpython-sht31d\npip3 install board<\/code><\/pre>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>\u0421\u0430\u043c \u043a\u043e\u0434 \u043d\u0430 Python:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import board\nimport busio\nimport adafruit_sht31d\nimport time\ni2c = busio.I2C(board.SCL, board.SDA)\nsensor = adafruit_sht31d.SHT31D(i2c, 0x44)\nwhile True:\nprint('Temp = {:.1f} \\u00B0C'.format(sensor.temperature))\nprint('RH = {:.1f} %\\n'.format(sensor.relative_humidity))\ntime.sleep(5)\n<\/code><\/pre>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>python <strong>script<\/strong>.py<\/code><\/pre>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b: \u0420\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u044d\u0442\u043e \u0432\u0441\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e \u0448\u0438\u043d\u0435 I2C, \u0432\u043a\u043b\u044e\u0447\u0438\u043c \u0435\u0451 \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b -&gt; Raspberry Pi Configuration -&gt; interfaces -&gt; I2C -&gt; \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0427\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u044c : \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0434\u0430\u0442\u0447\u0438\u043a \u043a GPIO Raspberry Pi: \u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u0442\u0447\u0438\u043a\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c : \u0423\u0442\u0438\u043b\u0438\u0442\u0430 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0438\u0434 \u0434\u0430\u0442\u0447\u0438\u043a\u0430 \u0423\u0437\u043d\u0430\u0435\u043c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443 \u043d\u0430\u0441 I2C \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u043e\u0432: \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u0442\u0447\u0438\u043a\u0438: \u0414\u0430\u043b\u044c\u0448\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"wp-custom-template-1","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[],"class_list":["post-965","post","type-post","status-publish","format-standard","hentry","category-raspberry-pi"],"_links":{"self":[{"href":"https:\/\/rantivi.ru\/index.php?rest_route=\/wp\/v2\/posts\/965","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rantivi.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rantivi.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rantivi.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rantivi.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=965"}],"version-history":[{"count":10,"href":"https:\/\/rantivi.ru\/index.php?rest_route=\/wp\/v2\/posts\/965\/revisions"}],"predecessor-version":[{"id":986,"href":"https:\/\/rantivi.ru\/index.php?rest_route=\/wp\/v2\/posts\/965\/revisions\/986"}],"wp:attachment":[{"href":"https:\/\/rantivi.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=965"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rantivi.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=965"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rantivi.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=965"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}