{"id":1671,"date":"2021-06-03T16:31:02","date_gmt":"2021-06-03T08:31:02","guid":{"rendered":"http:\/\/mgspace.wiki\/docs\/?post_type=docs&#038;p=1671"},"modified":"2021-06-04T18:49:04","modified_gmt":"2021-06-04T10:49:04","slug":"%e7%ae%a1%e8%84%9ai-o%e5%8f%a3","status":"publish","type":"docs","link":"http:\/\/mgspace.wiki\/docs\/?docs=%e7%ae%a1%e8%84%9ai-o%e5%8f%a3","title":{"rendered":"\u7ba1\u811a\u53caI\/O\u53e3"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">\u7b80\u4ecb\uff1a<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">I\/O\u53e3\u987e\u540d\u601d\u4e49\uff0c\u5c31\u662fInput\uff08\u8f93\u5165\uff09\u548cOutput\uff08\u8f93\u51fa\uff09\u7684\u603b\u79f0<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728Arduino\u677f\u4e0a\uff0c\u5927\u90e8\u5206\u7684\u5f15\u811a\uff0c\u65e2\u53ef\u4ee5\u4f5c\u4e3a\u8f93\u5165\uff08\u8bfb\u53d6\u4fe1\u53f7\uff09\uff0c\u4e5f\u53ef\u4ee5\u4f5c\u4e3a\u8f93\u51fa\uff08\u63a7\u5236\u8bbe\u5907\uff09\u4f7f\u7528<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"724\" src=\"http:\/\/mgspace.wiki\/docs\/wp-content\/uploads\/2021\/06\/20190710133650704-1024x724.png\" alt=\"\" class=\"wp-image-1678\" srcset=\"http:\/\/mgspace.wiki\/docs\/wp-content\/uploads\/2021\/06\/20190710133650704-1024x724.png 1024w, http:\/\/mgspace.wiki\/docs\/wp-content\/uploads\/2021\/06\/20190710133650704-500x354.png 500w, http:\/\/mgspace.wiki\/docs\/wp-content\/uploads\/2021\/06\/20190710133650704-768x543.png 768w, http:\/\/mgspace.wiki\/docs\/wp-content\/uploads\/2021\/06\/20190710133650704.png 1086w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\">\u5f15\u811a\u603b\u89c8<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Arduino\u4e0a\u5171\u670944\u4e2a\u5f15\u811a\uff0c\u5176\u4e2d\u5305\u62ec\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>\u6570\u5b57\u91cfI\/O\u5f15\u811a-14<\/strong>\u4e2a\uff08\u5f15\u811a\u7f16\u53f70-13\uff09<\/li><li><strong>\u6a21\u62df\u91cf\u8f93\u5165\u5f15\u811a-6\u4e2a<\/strong>\uff08\u5f15\u811a\u7f16\u53f7A0-A5)<\/li><li><strong>ICSP\u5f15\u811a-2\u7ec4<\/strong>\uff08\u6bcf\u7ec46\u4e2a\uff09\uff1a\u53ef\u901a\u8fc7\u7f16\u7a0b\u7535\u7f06\u8fde\u63a5\u5230\u7f16\u7a0b\u5668\u8bbe\u5907<\/li><li><strong>VIN<\/strong>\u5f15\u811a \uff1a \u8be5\u5f15\u811a\u7528\u4e8e\u4f7f\u7528\u5916\u90e8\u7535\u6e90\u4e3aArduino Uno\u5f00\u53d1\u677f\u4f9b\u7535<\/li><li><strong>5v\u548c3v3\u7535\u6e90\u63a5\u53e3<\/strong><\/li><li><strong>GND\u63a5\u53e3<\/strong>\uff08\u51713\u4e2a\uff09<\/li><li><strong>IOREF<\/strong>&nbsp;\u2013 \u8be5\u5f15\u811a\u662f\u8f93\u5165\/\u8f93\u51fa\u53c2\u8003\uff0c\u5b83\u63d0\u4f9b\u4e86\u5fae\u63a7\u5236\u5668\u5de5\u4f5c\u7684\u53c2\u8003\u7535\u538b\u3002<\/li><li><strong>Aref<\/strong>&nbsp;\u2013 \u6a21\u62df\u8f93\u5165\u7684\u53c2\u8003\u7535\u538b<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u6570\u5b57\u3001\u6a21\u62df\u548c\u8f93\u5165\u3001\u8f93\u51fa<\/h1>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><\/td><td>\u8f93\u5165(Input)<\/td><td>\u8f93\u51fa(Output)<\/td><\/tr><tr><td>\u6570\u5b57\u53e3(Digital)<\/td><td>0\/1(\u6570\u5b57\u8f93\u5165)<\/td><td>0\/1(\u6570\u5b57\u8f93\u51fa)  <br>0-255(PWM\u6a21\u62df\u8f93\u51fa)<\/td><\/tr><tr><td>\u6a21\u62df\u53e3(Analog)<\/td><td>0-1023(\u6a21\u62df\u8f93\u5165)<\/td><td>0\/1(\u6570\u5b57\u8f93\u51fa)\u300c\u6392\u9664 A6\u3001A7\u300d<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<div class=\"mve-callout mve-callout-warning\" class=\"wp-block-mve-callout-warning\"><h4><span class=\"dashicons dashicons-warning\"><\/span>\u8b66\u544a<\/h4>Arduino nano\u6bd4uno\u677f\u591a\u4e86\u4e24\u4e2aA6\u548cA7\u7684\u6a21\u62df\u53e3\uff0c\u4f46\u662f\u8fd9\u4e24\u4e2a\u6a21\u62df\u53e3\u786e\u5b9e\u529f\u80fd\u6b8b\u7f3a\u7684\u53e3\uff0c\u53ea\u652f\u6301\u6a21\u62df\u8f93\u5165\uff1aThe analog input pins can be used as digital pins, referred to as A0, A1, etc. The exception is the Arduino Nano, Pro Mini, and Mini\u2019s A6 and A7 pins, which can only be used as analog inputs.\uff08\u8f6c\u81ea-Arduino.cc\uff09<\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Output\u8f93\u51fa<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"989\" height=\"405\" src=\"http:\/\/mgspace.wiki\/docs\/wp-content\/uploads\/2021\/06\/image-10.png\" alt=\"\" class=\"wp-image-1683\" srcset=\"http:\/\/mgspace.wiki\/docs\/wp-content\/uploads\/2021\/06\/image-10.png 989w, http:\/\/mgspace.wiki\/docs\/wp-content\/uploads\/2021\/06\/image-10-500x205.png 500w, http:\/\/mgspace.wiki\/docs\/wp-content\/uploads\/2021\/06\/image-10-768x314.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Input\u8f93\u5165<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"684\" height=\"378\" src=\"http:\/\/mgspace.wiki\/docs\/wp-content\/uploads\/2021\/06\/image-11.png\" alt=\"\" class=\"wp-image-1684\" srcset=\"http:\/\/mgspace.wiki\/docs\/wp-content\/uploads\/2021\/06\/image-11.png 684w, http:\/\/mgspace.wiki\/docs\/wp-content\/uploads\/2021\/06\/image-11-500x276.png 500w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u7ba1\u811a\u6a21\u5f0f<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">I\/O\u53e3\u65e2\u53ef\u4ee5\u8bbe\u7f6e\u4e3a\u8f93\u5165\uff0c\u4e5f\u53ef\u4ee5\u8bbe\u7f6e\u4e3a\u8f93\u51fa\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u7ba1\u6559\u6a21\u5f0f\u6a21\u5757\u6765\u8fdb\u884c\u8bbe\u7f6e<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"718\" height=\"219\" src=\"http:\/\/mgspace.wiki\/docs\/wp-content\/uploads\/2021\/06\/image-12.png\" alt=\"\" class=\"wp-image-1686\" srcset=\"http:\/\/mgspace.wiki\/docs\/wp-content\/uploads\/2021\/06\/image-12.png 718w, http:\/\/mgspace.wiki\/docs\/wp-content\/uploads\/2021\/06\/image-12-500x153.png 500w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u4ec0\u4e48\u662f\u4e0a\u62c9\u8f93\u5165\uff1f<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u4e0a\u62c9\u7535\u963b<\/strong><br>\u5728\u6570\u5b57\u7535\u8def\u4e2d\uff0c\u4e0a\u62c9\u7535\u963b\uff08\u82f1\u8bed\uff1aPull-up resistors\uff09\u662f\u5f53\u67d0\u8f93\u5165\u7aef\u53e3\u672a\u8fde\u63a5\u8bbe\u5907\u6216\u5904\u4e8e\u9ad8\u963b\u6297\u7684\u60c5\u51b5\u4e0b\uff0c\u4e00\u79cd\u7528\u4e8e\u4fdd\u8bc1\u8f93\u5165\u4fe1\u53f7\u4e3a\u9884\u671f\u903b\u8f91\u7535\u5e73\u7684\u7535\u963b\u5143\u4ef6\u3002\u4ed6\u4eec\u901a\u5e38\u5728\u4e0d\u540c\u7684\u903b\u8f91\u5668\u4ef6\u4e4b\u95f4\u5de5\u4f5c\uff0c\u63d0\u4f9b\u4e00\u5b9a\u7684\u7535\u538b\u4fe1\u53f7\u3002<\/p>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter size-medium\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"448\" src=\"http:\/\/mgspace.wiki\/docs\/wp-content\/uploads\/2021\/06\/image-13-500x448.png\" alt=\"\" class=\"wp-image-1687\" srcset=\"http:\/\/mgspace.wiki\/docs\/wp-content\/uploads\/2021\/06\/image-13-500x448.png 500w, http:\/\/mgspace.wiki\/docs\/wp-content\/uploads\/2021\/06\/image-13.png 623w\" sizes=\"auto, (max-width: 500px) 85vw, 500px\" \/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u4e0a\u62c9\u7535\u963b\u7684\u4f5c\u7528<\/strong><br>\u5728\u4e0a\u62c9\u7535\u963b\u6240\u8fde\u63a5\u7684\u5bfc\u7ebf\u4e0a\uff0c\u5982\u679c\u5916\u90e8\u7ec4\u4ef6\u672a\u542f\u7528\uff0c\u4e0a\u62c9\u7535\u963b\u5c06\u201c\u5fae\u5f31\u5730\u201d\u5c06\u8f93\u5165\u7535\u538b\u4fe1\u53f7\u201c\u62c9\u9ad8\u201d\u3002\u5f53\u5916\u90e8\u7ec4\u4ef6\u672a\u8fde\u63a5\u65f6\uff0c\u5bf9\u8f93\u5165\u7aef\u6765\u8bf4\uff0c\u5916\u90e8\u201c\u770b\u4e0a\u53bb\u201d\u5c31\u662f\u9ad8\u963b\u6297\u7684\u3002\u8fd9\u65f6\uff0c\u901a\u8fc7\u4e0a\u62c9\u7535\u963b\u53ef\u4ee5\u5c06\u8f93\u5165\u7aef\u53e3\u5904\u7684\u7535\u538b\u62c9\u9ad8\u5230\u9ad8\u7535\u5e73\u3002\u5982\u679c\u5916\u90e8\u7ec4\u4ef6\u542f\u7528\uff0c\u5b83\u5c06\u53d6\u6d88\u4e0a\u62c9\u7535\u963b\u6240\u8bbe\u7f6e\u7684\u9ad8\u7535\u5e73\u3002\u901a\u8fc7\u8fd9\u6837\uff0c\u4e0a\u62c9\u7535\u963b\u53ef\u4ee5\u4f7f\u5f15\u811a\u5373\u4f7f\u5728\u672a\u8fde\u63a5\u5916\u90e8\u7ec4\u4ef6\u7684\u65f6\u5019\u4e5f\u80fd\u4fdd\u6301\u786e\u5b9a\u7684\u903b\u8f91\u7535\u5e73\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"379\" src=\"http:\/\/mgspace.wiki\/docs\/wp-content\/uploads\/2021\/06\/image-14-1024x379.png\" alt=\"\" class=\"wp-image-1689\" srcset=\"http:\/\/mgspace.wiki\/docs\/wp-content\/uploads\/2021\/06\/image-14-1024x379.png 1024w, http:\/\/mgspace.wiki\/docs\/wp-content\/uploads\/2021\/06\/image-14-500x185.png 500w, http:\/\/mgspace.wiki\/docs\/wp-content\/uploads\/2021\/06\/image-14-768x284.png 768w, http:\/\/mgspace.wiki\/docs\/wp-content\/uploads\/2021\/06\/image-14-1200x444.png 1200w, http:\/\/mgspace.wiki\/docs\/wp-content\/uploads\/2021\/06\/image-14.png 1304w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fde\u63a5\u4e24\u6839\u5bfc\u7ebf\u5230Arduino\u5f00\u53d1\u677f\u3002\u7528\u9ed1\u8272\u5bfc\u7ebf\u5c06\u5730\u8fde\u63a5\u5230\u6309\u952e\u7684\u4e00\u811a\u3002\u7b2c\u4e8c\u6839\u5bfc\u7ebf\u5c06A0\u811a\u8fde\u63a5\u5230\u6309\u952e\u7684\u53e6\u4e00\u4e2a\u5f15\u811a\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5f53\u6309\u4e0b\u6309\u952e\u6216\u5f00\u5173\u65f6\uff0c\u7535\u8def\u7684\u4e24\u7aef\u8fde\u63a5\u5728\u4e00\u8d77\u3002\u5f53\u6309\u952e\u65ad\u5f00\uff08\u672a\u6309\u4e0b\uff09\u65f6\uff0c\u6309\u952e\u4e24\u7aef\u6ca1\u6709\u8fde\u63a5\u3002\u7531\u4e8eA0\u7684\u5185\u90e8\u4e0a\u62c9\u7535\u963b\u5df2\u7ecf\u6fc0\u6d3b\uff0c\u5e76\u8fde\u63a5\u52305V\uff0c\u8bfb\u53d6\u65f6\u4e3a\u9ad8\u7535\u5e73HIGH\u3002\u5f53\u6309\u952e\u95ed\u5408\u65f6\uff0cArdunio\u8bfb\u53d6\u4e3a\u4f4e\u7535\u5e73\uff0c\u56e0\u4e3a\u8be5\u5f15\u811a\u8fde\u63a5\u5230\u5730\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7b80\u4ecb\uff1a I\/O\u53e3\u987e\u540d\u601d\u4e49\uff0c\u5c31\u662fInput\uff08\u8f93\u5165\uff09\u548cOutput\uff08\u8f93\u51fa\uff09\u7684\u603b\u79f0 \u5728Arduino\u677f\u4e0a\uff0c\u5927\u90e8\u5206\u7684\u5f15 &hellip; <a href=\"http:\/\/mgspace.wiki\/docs\/?docs=%e7%ae%a1%e8%84%9ai-o%e5%8f%a3\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201c\u7ba1\u811a\u53caI\/O\u53e3\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[65],"doc_tag":[],"class_list":["post-1671","docs","type-docs","status-publish","hentry","doc_category-i-o"],"_links":{"self":[{"href":"http:\/\/mgspace.wiki\/docs\/index.php?rest_route=\/wp\/v2\/docs\/1671","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/mgspace.wiki\/docs\/index.php?rest_route=\/wp\/v2\/docs"}],"about":[{"href":"http:\/\/mgspace.wiki\/docs\/index.php?rest_route=\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"http:\/\/mgspace.wiki\/docs\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/mgspace.wiki\/docs\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1671"}],"version-history":[{"count":14,"href":"http:\/\/mgspace.wiki\/docs\/index.php?rest_route=\/wp\/v2\/docs\/1671\/revisions"}],"predecessor-version":[{"id":1755,"href":"http:\/\/mgspace.wiki\/docs\/index.php?rest_route=\/wp\/v2\/docs\/1671\/revisions\/1755"}],"wp:attachment":[{"href":"http:\/\/mgspace.wiki\/docs\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1671"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"http:\/\/mgspace.wiki\/docs\/index.php?rest_route=%2Fwp%2Fv2%2Fdoc_category&post=1671"},{"taxonomy":"doc_tag","embeddable":true,"href":"http:\/\/mgspace.wiki\/docs\/index.php?rest_route=%2Fwp%2Fv2%2Fdoc_tag&post=1671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}