{"id":1848,"date":"2017-12-24T19:16:56","date_gmt":"2017-12-24T11:16:56","guid":{"rendered":"https:\/\/drho.club\/?p=1848"},"modified":"2017-12-24T19:16:56","modified_gmt":"2017-12-24T11:16:56","slug":"arduino-unit-8","status":"publish","type":"post","link":"https:\/\/104.es\/index.php\/2017\/12\/24\/arduino-unit-8\/","title":{"rendered":"[Arduino\u521d\u968e\u5be6\u7fd2] Unit 8\uff1a\u5149\u654f\u96fb\u963b\u5be6\u7fd2"},"content":{"rendered":"<p>\u5149\u654f\u96fb\u963b\u662f\u975e\u5e38\u6709\u8da3\u7684\u4e00\u7a2e\u96f6\u4ef6\uff0c\u5b83\u662f\u4e00\u7a2e\u4f9d\u7167\u5149\u5ea6\u800c\u6539\u8b8a\u81ea\u5df1\u96fb\u963b\u503c\u7684\u5143\u4ef6\uff0c\u4e5f\u56e0\u70ba\u5982\u6b64\uff0c\u8a31\u591a\u548c\u5149\u8207\u4eae\u5ea6\u6709\u95dc\u7684\u5be6\u7fd2\uff0c\u90fd\u9700\u8981\u4f7f\u7528\u5149\u654f\u96fb\u963b\u3002\u5728\u9019\u4e00\u55ae\u5143\u4e2d\uff0c\u6211\u5011\u5c31\u4f86\u505a\u505a\u4e00\u4e9b\u7c21\u55ae\u7684\u96fb\u8def\uff0c\u4f86\u89c0\u5bdf\u5149\u654f\u96fb\u963b\u7684\u7279\u6027\uff0c\u4e5f\u6703\u505a\u4e00\u500b\u7531\u5149\u7dda\u7684\u660e\u4eae\u5ea6\u4f86\u6c7a\u5b9a\u662f\u5426\u9ede\u4eaeLED\u7684\u5c0f\u7a0b\u5f0f\u3002<\/p>\n<p>\u540c\u6a23\u7684\uff0c\u4e5f\u6709\u5c08\u9580\u70baArduino\u8a2d\u8a08\u7684\u6a21\u7d44\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/104.es\/wp-content\/uploads\/2017\/12\/DSC_0302-1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1849\" src=\"https:\/\/104.es\/wp-content\/uploads\/2017\/12\/DSC_0302-1.jpg\" alt=\"\" width=\"800\" height=\"450\" srcset=\"https:\/\/104.es\/wp-content\/uploads\/2017\/12\/DSC_0302-1.jpg 800w, https:\/\/104.es\/wp-content\/uploads\/2017\/12\/DSC_0302-1-300x169.jpg 300w, https:\/\/104.es\/wp-content\/uploads\/2017\/12\/DSC_0302-1-768x432.jpg 768w, https:\/\/104.es\/wp-content\/uploads\/2017\/12\/DSC_0302-1-600x338.jpg 600w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n<p>\u5b83\u5df2\u7d93\u5e6b\u6211\u5011\u8a2d\u8a08\u597d\u96fb\u8def\uff0c\u6211\u5011\u8981\u505a\u7684\u53ea\u662f\u628a\u5b83\u548cArduino\u9023\u63a5\u5728\u4e00\u8d77\u5c31\u597d\u4e86\u3002\u4e0d\u904e\uff0c\u5728\u9019\u4e00\u55ae\u5143\u55ae\uff0c\u6211\u5011\u5c07\u4f7f\u7528\u7684\u662f\u55ae\u7d14\u7684\u5149\u654f\u96fb\u963b\u4f86\u505a\u5be6\u9a57\uff0c\u5b83\u7684\u50f9\u683c\u4fbf\u591a\u4e86\uff0c\u4e00\u500b\u4e0d\u5230\u53f0\u5e6310\u5143\u3002\u628a\u5b83\u63d2\u5230\u9eb5\u5305\u677f\u4e0a\u770b\u8d77\u4f86\u50cf\u662f\u4e0b\u9762\u9019\u500b\u6a23\u5b50\uff1a<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/104.es\/wp-content\/uploads\/2017\/12\/2017-12-24-18.48.57.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1850\" src=\"https:\/\/104.es\/wp-content\/uploads\/2017\/12\/2017-12-24-18.48.57.jpg\" alt=\"\" width=\"400\" height=\"297\" \/><\/a><\/p>\n<p>\u6211\u5011\u4e0d\u5728\u9019\u908a\u63a2\u7a76\u5b83\u7684\u7279\u6027\uff0c\u540c\u5b78\u5011\u53ea\u8981\u77e5\u9053\u53ea\u8981\u4eae\u5ea6\u4e0d\u4e00\u6a23\uff0c\u5b83\u7684\u96fb\u963b\u503c\u5c31\u6703\u4e0d\u4e00\u6a23\uff0c\u800c\u4e14\u5149\u7dda\u6108\u5f37\uff0c\u5b83\u7684\u96fb\u963b\u503c\u5c31\u6703\u6108\u5c0f\u3002\u9084\u6709\uff0c\u5b83\u662f\u88ab\u52d5\u5143\u4ef6\uff0c\u8981\u80fd\u5920\u5075\u5074\u5230\u5b83\u4e0a\u9762\u7684\u8b8a\u5316\uff0c\u548c\u53ef\u8b8a\u96fb\u963b\u4e00\u6a23\uff0c\u4e5f\u662f\u9700\u8981\u628a\u5b83\u9023\u63a5\u5230\u96fb\u6e90\u4e0a\u3002\u4e0d\u904e\uff0c\u6709\u4e00\u9ede\u8981\u7279\u5225\u6ce8\u610f\u7684\u662f\uff0c\u7576\u5b83\u7684\u96fb\u963b\u6108\u5c0f\u7684\u6642\u5019\uff0c\u6d41\u904e\u5b83\u7684\u96fb\u6d41\u5c31\u6703\u6108\u5927\uff0c\u6709\u53ef\u80fd\u6703\u56e0\u70ba\u96fb\u963b\u503c\u592a\u5c0f\u800c\u5c0e\u81f4\u677f\u5b50\u71d2\u6bc0\uff0c\u56e0\u6b64\u5728\u4f7f\u7528\u4e4b\u524d\uff0c\u4e5f\u662f\u9700\u8981\u52a0\u4e0a\u9650\u6d41\u96fb\u963b\uff0c\u800c\u6211\u5011\u662f\u5f9e\u9650\u6d41\u96fb\u963b\u548c\u5149\u654f\u96fb\u963b\u7684\u9023\u63a5\u9ede\u8655\u63a5\u51fa\u5c0e\u5411\uff0c\u9023\u5411Arduino\u4e0a\u7684\u8f38\u5165\u9023\u63a5\u7aef\uff0c\u5728\u6b64\u4ee5A2\u70ba\u4f8b\uff0c\u4ee5\u4e0b\u662f\u6211\u5011\u7684\u96fb\u8def\u5716\uff1a<\/p>\n<p><a href=\"https:\/\/104.es\/wp-content\/uploads\/2017\/12\/2017-12-24_11-26-53.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-1851 aligncenter\" src=\"https:\/\/104.es\/wp-content\/uploads\/2017\/12\/2017-12-24_11-26-53.png\" alt=\"\" width=\"790\" height=\"401\" srcset=\"https:\/\/104.es\/wp-content\/uploads\/2017\/12\/2017-12-24_11-26-53.png 908w, https:\/\/104.es\/wp-content\/uploads\/2017\/12\/2017-12-24_11-26-53-300x152.png 300w, https:\/\/104.es\/wp-content\/uploads\/2017\/12\/2017-12-24_11-26-53-768x390.png 768w, https:\/\/104.es\/wp-content\/uploads\/2017\/12\/2017-12-24_11-26-53-600x305.png 600w\" sizes=\"auto, (max-width: 790px) 100vw, 790px\" \/><\/a><\/p>\n<p>\u5982\u4e0a\u5716\u6240\u793a\uff0c5V\u63a5\u5230\u5149\u654f\u96fb\u963b\uff0c\u7136\u5f8c\u5149\u654f\u96fb\u963b\u7684\u53e6\u5916\u4e00\u7aef\u9023\u63a5\u5230\u96fb\u963b\u4ee5\u53caA2\u8f38\u5165\u7aef\uff0c\u7136\u5f8c\u96fb\u963b\u7684\u53e6\u5916\u4e00\u982d\u5247\u662f\u9023\u63a5\u5230GND\uff0c\u5be6\u969b\u9023\u63a5\u96fb\u8def\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/104.es\/wp-content\/uploads\/2017\/12\/2017-12-24-19.05.31.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1852\" src=\"https:\/\/104.es\/wp-content\/uploads\/2017\/12\/2017-12-24-19.05.31.jpg\" alt=\"\" width=\"800\" height=\"450\" srcset=\"https:\/\/104.es\/wp-content\/uploads\/2017\/12\/2017-12-24-19.05.31.jpg 800w, https:\/\/104.es\/wp-content\/uploads\/2017\/12\/2017-12-24-19.05.31-300x169.jpg 300w, https:\/\/104.es\/wp-content\/uploads\/2017\/12\/2017-12-24-19.05.31-768x432.jpg 768w, https:\/\/104.es\/wp-content\/uploads\/2017\/12\/2017-12-24-19.05.31-600x338.jpg 600w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n<p>\u63a5\u597d\u96fb\u8def\u4e4b\u5f8c\uff0c\u5c31\u53ef\u4ee5\u4f7f\u7528analogRead(A2)\u8b80\u53d6\u5230\u5728\u5149\u654f\u96fb\u963b\u4e0a\u7684\u8f38\u5165\u503c\u3002\u4f46\u662f\u5f97\u5230\u8f38\u5165\u503c\u4e4b\u5f8c\uff0c\u6211\u5011\u8981\u5982\u4f55\u5f97\u77e5\u5230\u5e95\u662f\u591a\u5c11\u5462\uff1fArduino IED\u6709\u4e00\u500b\u5e8f\u5217\u57e0\u76e3\u63a7\u8996\u7a97\u53ef\u4ee5\u8b93\u6211\u5011\u89c0\u5bdf\u7a0b\u5f0f\u4e2d\u8b8a\u6578\u7684\u5167\u5bb9\uff0c\u5148\u4f86\u770b\u7a0b\u5f0f\u7684\u90e8\u4efd\uff1a<\/p>\n<p>https:\/\/gist.github.com\/skynettw\/2738f330ca106b99fa58cee28b883b65<\/p>\n<p>\u6c92\u932f\uff0c\u7a0b\u5f0f\u5c31\u9019\u9ebc\u7c21\u55ae\u3002\u9019\u6642\u5019\u53ef\u4ee5\u958b\u555f\u5728Arduino\u4e0a\u5de5\u5177\u9078\u55ae\u4e2d\u7684\u5e8f\u5217\u57e0\u76e3\u63a7\u8996\u7a97\uff0c\u7136\u5f8c\u4f60\u4f7f\u7528\u624b\u96fb\u7b52\uff08\u624b\u6a5f\u7684\u5c31\u53ef\u4ee5\u4e86\u5566\uff09\u6216\u662f\u5728\u5149\u654f\u96fb\u963b\u4e0a\u7528\u624b\u906e\u4e00\u4e0b\u5149\u7dda\uff0c\u5c31\u53ef\u4ee5\u770b\u5230\u6578\u503c\u7684\u8b8a\u5316\u3002\u5982\u679c\u770b\u5230\u4e82\u78bc\u7684\u8a71\uff0c\u5225\u5fd8\u4e86\u53f3\u4e0b\u89d2\u7684baud\u6578\u5b57\u8981\u6539\u70ba9600\uff0c\u540c\u6642\u4e5f\u8981\u78ba\u5b9a\u9078\u7528\u7684\u662f\u6c92\u6709\u884c\u7d50\u5c3e\u7684\u9078\u9805\u3002<\/p>\n<p><a href=\"https:\/\/104.es\/wp-content\/uploads\/2017\/12\/2017-12-24_19-10-16.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1853 aligncenter\" src=\"https:\/\/104.es\/wp-content\/uploads\/2017\/12\/2017-12-24_19-10-16.png\" alt=\"\" width=\"730\" height=\"684\" srcset=\"https:\/\/104.es\/wp-content\/uploads\/2017\/12\/2017-12-24_19-10-16.png 730w, https:\/\/104.es\/wp-content\/uploads\/2017\/12\/2017-12-24_19-10-16-300x281.png 300w, https:\/\/104.es\/wp-content\/uploads\/2017\/12\/2017-12-24_19-10-16-600x562.png 600w\" sizes=\"auto, (max-width: 730px) 100vw, 730px\" \/><\/a><\/p>\n<p>\u53ef\u4ee5\u770b\u5230\u7684\u662f\uff0c\u6578\u503c\u7684\u8b8a\u5316\u91cf\u548c\u4f60\u4f7f\u7528\u7684\u9650\u6d41\u96fb\u963b\u503c\u6709\u95dc\uff0c\u6b64\u5916\uff0c\u6211\u5011\u9019\u7a2e\u63a5\u6cd5\u6703\u5728\u5149\u654f\u96fb\u963b\u7684\u96fb\u963b\u503c\u6108\u5c0f\u6642\uff0c\u89c0\u5bdf\u5230\u7684\u6578\u503c\u6108\u5927\uff0c\u540c\u5b78\u5011\u53ef\u4ee5\u60f3\u60f3\u770b\u662f\u70ba\u4ec0\u9ebc\u5594\u3002\u63a5\u4e0b\u4f86\uff0c\u540c\u5b78\u5011\u8981\u505a\u7684\u662f\uff0c\u89c0\u5bdf\u6578\u503c\u7684\u8b8a\u5316\uff0c\u7136\u5f8c\u627e\u51fa\u4e00\u500b\u81e8\u754c\u503c\uff0c\u7528\u4f86\u7576\u505a\u662f\u5f85\u6703\u5152\u8981\u9ede\u4eae\u63a5\u5728\u7b2c13\u652f\u63a5\u8173\u7684LED\u4e4b\u4f9d\u64da\u3002\u4fee\u6539\u5f8c\u7684\u7a0b\u5f0f\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<p>https:\/\/gist.github.com\/skynettw\/6fcb92d88e3976cd4554eea049a69fa8<\/p>\n<p>\u5728\u9019\u88e1\u4f7f\u7528\u4e86\u53e6\u5916\u4e00\u500bC\u7a0b\u5f0f\u8a9e\u8a00\u7684\u6d41\u7a0b\u63a7\u5236\u8a9e\u6cd5if\/else\uff0c\u5728if\u5f8c\u9762\u4e00\u5b9a\u8981\u52a0\u4e0a\u5c0f\u62ec\u865f\uff0c\u5728\u5c0f\u62ec\u865f\u4e2d\u6307\u5b9a\u4e86\u8981\u6aa2\u67e5\u7684\u689d\u4ef6\uff0c\u5982\u679c\u6210\u7acb\u5c31\u57f7\u884c\u4ee5\u4e0b\u7b2c\u4e00\u500b\u5927\u62ec\u865f\u4e4b\u9593\u7684\u5167\u5bb9\uff0c\u5982\u679c\u4e0d\u6210\u7acb\u7684\u8a71\uff0c\u5c31\u57f7\u884celse\u5e95\u4e0b\u5927\u62ec\u865f\u7684\u5167\u5bb9\u3002<\/p>\n<p>\u6240\u4ee5\uff0c\u5982\u4e0a\u8ff0\u7684\u7a0b\u5f0f\u6240\u8a2d\u8a08\u7684\u5167\u5bb9\uff0c\u5982\u679c\u5f9eA2\u62ff\u5230\u7684\u503c\u5c0f\u65bc10\uff0c\u5c31\u9ede\u4eae\u7b2c13\u91dd\u8173\u7684LED\uff0c\u5426\u5247\u5c31\u628a\u5b83\u7184\u6ec5\uff0c\u7136\u5f8c\u7b49\u5f850.5\u79d2\u4e4b\u5f8c\u518d\u6aa2\u67e5\u4e00\u6b21\u3002\u540c\u5b78\u5011\u53ef\u4ee5\u60f3\u50cf\uff0c\u5982\u679c\u7b2c13\u652f\u91dd\u8173\u6240\u5728\u7684\u4f4d\u7f6e\u9a45\u52d5\u7684\u662f\u4e00\u76de\u8def\u71c8\u7684\u8a71\uff0c\u90a3\u5c31\u662f\u4e00\u500b\u53ef\u4ee5\u4f9d\u5929\u8272\u800c\u81ea\u52d5\u660e\u6ec5\u7684\u96fb\u71c8\u4e86\u3002\u4ee5\u4e0b\u662f\u57f7\u884c\u7684\u793a\u7bc4\u5f71\u7247\uff1a<\/p>\n<p><iframe loading=\"lazy\" title=\"\u900f\u904e\u5149\u654f\u96fb\u963b\u4f9d\u4eae\u5ea6\u6c7a\u5b9a\u662f\u5426\u9ede\u4eae13pin\u7684LED\u793a\u7bc4\u5f71\u7247\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/ElGPrzJhbGA?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5149\u654f\u96fb\u963b\u662f\u975e\u5e38\u6709\u8da3\u7684\u4e00\u7a2e\u96f6\u4ef6\uff0c\u5b83\u662f\u4e00\u7a2e\u4f9d\u7167\u5149\u5ea6\u800c\u6539\u8b8a\u81ea\u5df1\u96fb\u963b\u503c\u7684\u5143\u4ef6\uff0c\u4e5f\u56e0\u70ba\u5982\u6b64\uff0c\u8a31\u591a\u548c\u5149\u8207\u4eae\u5ea6\u6709\u95dc\u7684\u5be6\u7fd2\uff0c\u90fd\u9700\u8981\u4f7f\u7528\u5149\u654f\u96fb\u963b\u3002\u5728\u9019\u4e00\u55ae\u5143\u4e2d\uff0c\u6211\u5011\u5c31\u4f86\u505a\u505a\u4e00\u4e9b\u7c21\u55ae\u7684\u96fb\u8def\uff0c\u4f86\u89c0\u5bdf\u5149\u654f\u96fb\u963b\u7684\u7279\u6027\uff0c\u4e5f\u6703\u505a\u4e00\u500b\u7531\u5149\u7dda\u7684\u660e\u4eae\u5ea6\u4f86\u6c7a\u5b9a\u662f\u5426\u9ede\u4eaeLED\u7684\u5c0f\u7a0b\u5f0f\u3002<\/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-1848","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\/1848","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=1848"}],"version-history":[{"count":0,"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/posts\/1848\/revisions"}],"wp:attachment":[{"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/media?parent=1848"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/categories?post=1848"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/tags?post=1848"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}