{"id":699,"date":"2022-05-28T16:07:29","date_gmt":"2022-05-28T08:07:29","guid":{"rendered":"https:\/\/usei.cn\/?p=699"},"modified":"2022-05-28T16:07:30","modified_gmt":"2022-05-28T08:07:30","slug":"%e6%b8%a9%e6%b9%bf%e5%ba%a6%e4%bc%a0%e6%84%9f%e5%99%a8","status":"publish","type":"post","link":"https:\/\/usei.cn\/index.php\/2022\/05\/28\/%e6%b8%a9%e6%b9%bf%e5%ba%a6%e4%bc%a0%e6%84%9f%e5%99%a8\/","title":{"rendered":"\u6e29\u6e7f\u5ea6\u4f20\u611f\u5668"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/usei.cn\/wp-content\/uploads\/2022\/05\/image-12.png\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/usei.cn\/wp-content\/uploads\/2022\/05\/image-12.png'><img class=\"lazyload lazyload-style-3\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" width=\"552\" height=\"382\" data-original=\"https:\/\/usei.cn\/wp-content\/uploads\/2022\/05\/image-12.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-700\"  sizes=\"auto, (max-width: 552px) 100vw, 552px\" \/><\/div><\/a><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;SimpleDHT.h>\n\n\/\/ for DHT11, \n\/\/      VCC: 5V or 3V\n\/\/      GND: GND\n\/\/      DATA: 2\nint pinDHT11 = 2;\nSimpleDHT11 dht11(pinDHT11);\n\nvoid setup() {\n  Serial.begin(115200);\n}\n\nvoid loop() {\n  \/\/ start working...\n  Serial.println(\"=================================\");\n  Serial.println(\"Sample DHT11...\");\n  \n  \/\/ read without samples.\n  byte temperature = 0;\n  byte humidity = 0;\n  int err = SimpleDHTErrSuccess;\n  if ((err = dht11.read(&amp;temperature, &amp;humidity, NULL)) != SimpleDHTErrSuccess) {\n    Serial.print(\"Read DHT11 failed, err=\"); Serial.println(err);delay(1000);\n    return;\n  }\n  \n  Serial.print(\"Sample OK: \");\n  Serial.print((int)temperature); Serial.print(\" *C, \"); \n  Serial.print((int)humidity); Serial.println(\" H\");\n  \n  \/\/ DHT11 sampling rate is 1HZ.\n  delay(1500);\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[64,5],"tags":[],"class_list":["post-699","post","type-post","status-publish","format-standard","hentry","category-sensor","category-lot"],"_links":{"self":[{"href":"https:\/\/usei.cn\/index.php\/wp-json\/wp\/v2\/posts\/699","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/usei.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/usei.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/usei.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/usei.cn\/index.php\/wp-json\/wp\/v2\/comments?post=699"}],"version-history":[{"count":1,"href":"https:\/\/usei.cn\/index.php\/wp-json\/wp\/v2\/posts\/699\/revisions"}],"predecessor-version":[{"id":701,"href":"https:\/\/usei.cn\/index.php\/wp-json\/wp\/v2\/posts\/699\/revisions\/701"}],"wp:attachment":[{"href":"https:\/\/usei.cn\/index.php\/wp-json\/wp\/v2\/media?parent=699"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/usei.cn\/index.php\/wp-json\/wp\/v2\/categories?post=699"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/usei.cn\/index.php\/wp-json\/wp\/v2\/tags?post=699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}