{"id":2802,"date":"2018-05-28T15:26:14","date_gmt":"2018-05-28T07:26:14","guid":{"rendered":"https:\/\/drho.club\/?p=2201"},"modified":"2018-05-28T15:26:14","modified_gmt":"2018-05-28T07:26:14","slug":"arduino-unit-15","status":"publish","type":"post","link":"https:\/\/104.es\/index.php\/2018\/05\/28\/arduino-unit-15\/","title":{"rendered":"\u3010Arduino\u3011\u5404\u5f0f\u6309\u9215\u8f38\u5165"},"content":{"rendered":"<p>\u5728\u505aArduino\u5be6\u7fd2\u6642\uff0c\u5e38\u5e38\u6703\u9700\u8981\u7528\u5230\u6309\u9215\u8b80\u53d6\u5916\u90e8\u8cc7\u8a0a\uff0c\u6b64\u7bc7\u6587\u7ae0\u5c07\u7c21\u55ae\u4ecb\u7d39\u5e7e\u7a2e\u6309\u9215\u7684\u4f7f\u7528\u65b9\u5f0f\u3002<\/p>\n<p>\u6700\u5e38\u4f7f\u7528\u5f97\u6309\u9215\u5982\u4e0b\u5716\u6240\u793a:\u5176\u4e2d1\u30013\u548c2\u30014\u8173\u5206\u5225\u662f\u76f8\u901a\u7684\uff0c\u7576\u6309\u4e0b\u6309\u9215\u5f8c\u5de6\u53f3\u5169\u908a\u7684\u8173\u6703\u63a5\u901a\uff0c<\/p>\n<p><a href=\"https:\/\/104.es\/wp-content\/uploads\/2018\/05\/3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-2204 size-full\" src=\"https:\/\/104.es\/wp-content\/uploads\/2018\/05\/3.png\" alt=\"\" width=\"202\" height=\"255\" \/><\/a><a href=\"https:\/\/104.es\/wp-content\/uploads\/2018\/05\/4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2205\" src=\"https:\/\/104.es\/wp-content\/uploads\/2018\/05\/4.png\" alt=\"\" width=\"238\" height=\"135\" \/><\/a><a href=\"https:\/\/104.es\/wp-content\/uploads\/2018\/05\/5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2206\" src=\"https:\/\/104.es\/wp-content\/uploads\/2018\/05\/5.png\" alt=\"\" width=\"217\" height=\"146\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u73fe\u5728\u77e5\u9053\u6309\u9215\u7684\u52d5\u4f5c\u539f\u7406\u5f8c\uff0c\u900f\u904eArduino\u4f86\u8b80\u53d6\u6309\u9215\u7684\u8a0a\u606f\uff0c\u53ef\u4ee5\u7528\u6578\u4f4d\u8173\u4f86\u8b80\u53d6High\u8207Low\u8a0a\u865f\u3002<\/p>\n<p>\u63a5\u7dda: \u7576\u958b\u95dc\u6c92\u6709\u6309\u4e0b\u6642\uff0cpin2\u63a5\u8173\u70baHigh\uff0c\u958b\u95dc\u6309\u4e0b\u5f8cpin2\u5247\u8b8a\u70baLow<\/p>\n<p><a href=\"https:\/\/104.es\/wp-content\/uploads\/2018\/05\/6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2207 size-full\" src=\"https:\/\/104.es\/wp-content\/uploads\/2018\/05\/6.png\" alt=\"\" width=\"777\" height=\"734\" \/><\/a><\/p>\n<p>\u7a0b\u5f0f:<\/p>\n<p>[code]<\/p>\n<p>void setup() {<br \/>\nSerial.begin(9600);\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \/\/\u8a2d\u5b9a\u9b91\u7387\u70ba9600<br \/>\npinMode(2, INPUT);\u00a0 \u00a0 \u00a0 \u00a0 \/\/\u8a2d\u5b9aPin2\u70ba\u8f38\u5165\u63a5\u8173<br \/>\n}<\/p>\n<p>void loop() {<br \/>\nSerial.println( digitalRead(2));\u00a0 \u00a0 \u00a0 \/\/\u8b80\u53d6pin2\u4e26\u986f\u793a\u5728\u5e8f\u5217\u76e3\u63a7\u8996\u7a97<br \/>\ndelay(500);<br \/>\n}<\/p>\n<p>[\/code]<\/p>\n<p>\u5b8c\u6210\u4e0a\u50b3\u5f8c\u53ef\u4ee5\u958b\u8d77\u5e8f\u5217\u76e3\u63a7\u8996\u7a97\u4f86\u770bpin2\u7684\u503c<\/p>\n<p><a href=\"https:\/\/104.es\/wp-content\/uploads\/2018\/05\/7.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2208 size-full\" src=\"https:\/\/104.es\/wp-content\/uploads\/2018\/05\/7.png\" alt=\"\" width=\"903\" height=\"600\" \/><\/a><\/p>\n<p>\u7531\u4e0a\u9762\u7bc4\u4f8b\u53ef\u77e5\uff0c\u7576\u9700\u8981\u7528\u52305\u500b\u6309\u9215\u6642\uff0c\u5c31\u5fc5\u9808\u8981\u5360\u75285\u500b\u6578\u4f4d\u63a5\u8173\u4f86\u8b80\u53d6\u6578\u503c\uff0c\u800cArduino\u50c5\u63d0\u4f9b13\u96bb\u6578\u4f4d\u63a5\u8173\uff0c\u56e0\u6b64\u53ef\u80fd\u6703\u6709\u63a5\u8173\u6578\u4e0d\u5920\u7684\u60c5\u5f62\u767c\u751f\u3002<\/p>\n<p>\u70ba\u4e86\u89e3\u6c7a\u8173\u4f4d\u4e0d\u5920\u7684\u60c5\u6cc1\uff0c\u53ef\u4ee5\u75281\u96bb\u985e\u6bd4\u8173\u4f4d\u8b80\u53d6\u591a\u500b\u6309\u9215\u8f38\u5165\uff0c\u7dda\u8def\u63a5\u6cd5\u5982\u4e0b\u5716\uff0c\u4e3b\u8981\u662f\u900f\u904e\u5206\u58d3\u7684\u65b9\u5f0f\u4f86\u7d66A0\u8173\u4e0d\u540c\u7684\u503c\u3002<\/p>\n<p><a href=\"https:\/\/104.es\/wp-content\/uploads\/2018\/05\/1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2202 size-full\" src=\"https:\/\/104.es\/wp-content\/uploads\/2018\/05\/1.png\" alt=\"\" width=\"904\" height=\"483\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>\u7576\u5206\u5225\u6309\u4e0bS1\u6642\uff0cA0\u53ef\u4ee5\u5f97\u5230\u4e0d\u540c\u7684\u5206\u58d3\u503c\uff0c\u9eb5\u5305\u7248\u63a5\u7dda\u65b9\u5f0f\u5982\u4e0b\uff0c<\/p>\n<p><a href=\"https:\/\/104.es\/wp-content\/uploads\/2018\/05\/2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2203 size-full\" src=\"https:\/\/104.es\/wp-content\/uploads\/2018\/05\/2.png\" alt=\"\" width=\"708\" height=\"674\" \/><\/a><\/p>\n<p>\u7a0b\u5f0f:<\/p>\n<p>[code]<\/p>\n<p>void setup() {<br \/>\nSerial.begin(9600); \/\/\u8a2d\u5b9a\u9b91\u7387\u70ba9600<br \/>\n}<\/p>\n<p>void loop() {<br \/>\nSerial.println( analogRead(A0));\u00a0 \/\/\u8b80\u53d6A0\u8173\u503c<br \/>\ndelay(500);\u00a0 \u00a0 \/\/\u5ef6\u90720.5S<br \/>\n}<\/p>\n<p>[\/code]<\/p>\n<p>\u4e0a\u50b3\u5b8c\u6210\u5f8c\u958b\u59cb\u5e8f\u5217\u76e3\u63a7\u8996\u7a97\uff0c\u5206\u5225\u6309\u4e0bS1~S5\u4e26\u89c0\u5bdfA0\u503c\u7684\u6539\u8b8a\uff0c\u5982\u6b64\u4e00\u4f86\u5c31\u53ef\u4ee5\u900f\u904eA0\u7684\u6539\u8b8a\u4f86\u5224\u65b7\u4f7f\u7528\u8005\u6309\u4e0b\u7684\u6309\u9215\u70ba\u54ea\u4e00\u500b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u505aArduino\u5be6\u7fd2\u6642\uff0c\u5e38\u5e38\u6703\u9700\u8981\u7528\u5230\u6309\u9215\u8b80\u53d6\u5916\u90e8\u8cc7\u8a0a\uff0c\u6b64\u7bc7\u6587\u7ae0\u5c07\u7c21\u55ae\u4ecb\u7d39\u5e7e\u7a2e\u6309\u9215\u7684\u4f7f\u7528\u65b9\u5f0f\u3002 \u6700\u5e38\u4f7f\u7528\u5f97\u6309&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-2802","post","type-post","status-publish","format-standard","hentry","category-arduino"],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/posts\/2802","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/comments?post=2802"}],"version-history":[{"count":0,"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/posts\/2802\/revisions"}],"wp:attachment":[{"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/media?parent=2802"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/categories?post=2802"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/tags?post=2802"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}