{"id":308,"date":"2021-02-19T20:26:00","date_gmt":"2021-02-19T11:26:00","guid":{"rendered":"https:\/\/sakae-shokai.com\/?p=308"},"modified":"2021-02-19T18:31:37","modified_gmt":"2021-02-19T09:31:37","slug":"%e6%b8%a9%e5%ba%a6%e3%82%bb%e3%83%b3%e3%82%b5adt7410%e3%82%92%e7%94%a8%e3%81%84%e3%81%9f%e6%b8%a9%e5%ba%a6%e6%b8%ac%e5%ae%9a","status":"publish","type":"post","link":"https:\/\/sakae-shokai.com\/wordpress\/?p=308","title":{"rendered":"\u6e29\u5ea6\u30bb\u30f3\u30b5ADT7410\u3092\u7528\u3044\u305f\u6e29\u5ea6\u6e2c\u5b9a"},"content":{"rendered":"\n<p>\u524d\u56de\u306eDHT11\u304b\u3089\u3001\u6642\u9593\u304c\u305f\u3061\u307e\u3057\u305f\u304c\u3001\u30d6\u30ec\u30c3\u30c9\u30dc\u30fc\u30c9\u306b\u4e57\u3063\u3066\u3044\u305fADT7410\u3092\u7528\u3044\u3066\u3001\u6e29\u5ea6\u6e2c\u5b9a\u3092\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002DHT11\u306f\u30ef\u30f3\u30ef\u30a4\u30e4\u30fc\u3067\u3001ESP32\u81ea\u4f53\u3067\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u3082\u3063\u3066\u3044\u305f\u306e\u3067\u697d\u3067\u3057\u305f\u304c\u3001ADT7410\u3067\u306f\u3057\u3063\u304b\u308a\u3068\u30e1\u30fc\u30ab\u30fc\u306e\u4ed5\u69d8\u3092\u8aad\u3093\u3067\u304a\u304b\u306a\u3044\u3068\u3044\u3051\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>\u30e1\u30fc\u30ab\u30fc\u306e\u30a2\u30ca\u30ed\u30b0\u30c7\u30d0\u30a4\u30b7\u30b9\u306e\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u304b\u3089\u3001\u8cc7\u6599\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002<a href=\"https:\/\/www.analog.com\/media\/en\/technical-documentation\/data-sheets\/ADT7410.pdf\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.analog.com\/media\/en\/technical-documentation\/data-sheets\/ADT7410.pdf<\/a>\u306e12~13\u30da\u30fc\u30b8\u306b\u66f8\u3044\u3066\u3042\u308a\u307e\u3059\u304c\u300113\u30d3\u30c3\u30c8\u3067\u306e\u6e2c\u5b9a\u3067\u306f0x00\u304b\u30892\u30d0\u30a4\u30c8\u62fe\u3063\u3066\u3001\u304f\u3063\u3064\u3051\u3066\u3001\u3046\u3057\u308d\u306e3\u30d3\u30c3\u30c8\u5206\u3092\u5207\u308b\u3068\u8a00\u3046\u4f5c\u696d\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4eca\u56de\u306fscl\u309218\u30d4\u30f3\u306bsda\u309219\u30d4\u30f3\u306b\u8a2d\u5b9a\u3057\u307e\u3057\u305f\u3002ADT7410\u3082\u30d7\u30eb\u30a2\u30c3\u30d7\u304c\u5fc5\u8981\u306a\u306e\u3067\u3001\u307e\u305a\u306f\u30d7\u30eb\u30a2\u30c3\u30d7\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&gt;&gt;&gt; from machine import SoftI2C, Pin\n&gt;&gt;&gt; p18 = Pin(18, Pin.IN, Pin.PULL_UP)\n&gt;&gt;&gt; p19 = Pin(19, Pin.IN, Pin.PULL_UP)<\/code><\/pre>\n\n\n\n<p>\u305d\u306e\u5f8csofti2c\u3067\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&gt;&gt;&gt; data = SoftI2C(scl = Pin(18), sda = Pin(19), freq = 10000).readfrom_mem(0x48, 0x00, 2)<\/code><\/pre>\n\n\n\n<p>\u3053\u3053\u3067\u30012\u30d0\u30a4\u30c8\u5206\u306e\u30c7\u30fc\u30bf\u3092\u898b\u3066\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&gt;&gt;&gt; print(data&#91;0])\n10\n&gt;&gt;&gt; print(data&#91;1])\n224<\/code><\/pre>\n\n\n\n<p>10\u9032\u6570\u3067\u30d7\u30ea\u30f3\u30c8\u3055\u308c\u308b\u306e\u3067\u30012\u9032\u6570\u3067\u30d7\u30ea\u30f3\u30c8\u3055\u305b\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&gt;&gt;&gt; print(bin(data&#91;0]))\n0b1010\n&gt;&gt;&gt; print(bin(data&#91;1]))\n0b11100000<\/code><\/pre>\n\n\n\n<p>data[0]\u306f00001010\u3001data[1]\u306f11100000\u3068\u306a\u3063\u3066\u307e\u3059\u3002data[0]\u3092\u5de6\u306b8\u30d3\u30c3\u30c8\u305a\u3089\u3057\u3066data[1]\u3092\u3064\u306a\u3052\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&gt;&gt;&gt; print(bin(data&#91;0]&lt;&lt;8 |data&#91;1]))\n0b101011100000<\/code><\/pre>\n\n\n\n<p>0000101011100000\u3068\u306a\u308a\u307e\u3057\u305f\u3002\u53f3\u50743\u30d3\u30c3\u30c8\u306f\u4e0d\u8981\u3067\u3059\u304b\u3089\u3001\u53f3\u306b3\u30d3\u30c3\u30c8\u305a\u3089\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&gt;&gt;&gt; print(bin((data&#91;0]&lt;&lt;8 |data&#91;1]) &gt;&gt;3))\n0b101011100<\/code><\/pre>\n\n\n\n<p>0000101011100\u306b\u306a\u308a\u307e\u3057\u305f\u300210\u9032\u6570\u306b\u6cbb\u3059\u3068\u3001<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&gt;&gt;&gt; print(((data&#91;0]&lt;&lt;8 |data&#91;1]) &gt;&gt;3))  # temp=print(((data&#91;0]&lt;&lt;8 |data&#91;1]) &gt;&gt;3))\n348<\/code><\/pre>\n\n\n\n<p>\u3053\u308c\u309213\u30d3\u30c3\u30c8\u3067\u3059\u304b\u3089\u3001\u8cc7\u6599\u306b\u3042\u308b\u3068\u304a\u308a16\u3067\u5272\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&gt;&gt;&gt; print(((data&#91;0]&lt;&lt;8 |data&#91;1]) &gt;&gt;3)\/16)\n21.75<\/code><\/pre>\n\n\n\n<p>\u3053\u308c\u3067\u6e29\u5ea621.75\u5ea6\u304c\u51fa\u3066\u304d\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u30bb\u30f3\u30b5\u3067\u306f\u30de\u30a4\u30ca\u30b9\u306b\u306a\u308b\u3068\u30d5\u30a1\u30fc\u30b9\u30c8\u30d3\u30c3\u30c8\u306b1\u304c\u7acb\u3064\u306e\u3067\u300113\u30d3\u30c3\u30c8\u30671000000000000\u306f10\u9032\u6570\u30674096\u3067\u3059\u304b\u3089\u3001temp\u304c\u3053\u306e\u6570\u3088\u308a\u5927\u304d\u3044\u5834\u5408\u306f\u30de\u30a4\u30ca\u30b9\u306e\u6e29\u5ea6\u306b\u306a\u308b\u306e\u3067temp=temp-8192\u3068\u3059\u308c\u3070OK\u3067\u3059\u3002\u4f8b\u30d5\u30eb\u30d3\u30c3\u30c81111111111111\u306f10\u9032\u6570\u30678191\u3067\u3059\u304b\u3089\u30018191-8192=-1\u3053\u308c\u309216\u3067\u5272\u3063\u3066-0.0625\u5ea6\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u56de\u306eDHT11\u304b\u3089\u3001\u6642\u9593\u304c\u305f\u3061\u307e\u3057\u305f\u304c\u3001\u30d6\u30ec\u30c3\u30c9\u30dc\u30fc\u30c9\u306b\u4e57\u3063\u3066\u3044\u305fADT7410\u3092\u7528\u3044\u3066\u3001\u6e29\u5ea6\u6e2c\u5b9a\u3092\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002DHT11\u306f\u30ef\u30f3\u30ef\u30a4\u30e4\u30fc\u3067\u3001ESP32\u81ea\u4f53\u3067\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u3082\u3063\u3066\u3044\u305f\u306e\u3067\u697d\u3067\u3057\u305f\u304c\u3001ADT7410 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/sakae-shokai.com\/wordpress\/?p=308\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u6e29\u5ea6\u30bb\u30f3\u30b5ADT7410\u3092\u7528\u3044\u305f\u6e29\u5ea6\u6e2c\u5b9a&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":234,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,16,15],"tags":[31,18,19],"class_list":["post-308","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-esp32","category-micropython","category-15","tag-adt7410","tag-esp32","tag-micropython"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/sakae-shokai.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/308","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sakae-shokai.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sakae-shokai.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sakae-shokai.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sakae-shokai.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=308"}],"version-history":[{"count":10,"href":"https:\/\/sakae-shokai.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/308\/revisions"}],"predecessor-version":[{"id":318,"href":"https:\/\/sakae-shokai.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/308\/revisions\/318"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sakae-shokai.com\/wordpress\/index.php?rest_route=\/wp\/v2\/media\/234"}],"wp:attachment":[{"href":"https:\/\/sakae-shokai.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sakae-shokai.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=308"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sakae-shokai.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}