{"id":2797,"date":"2018-05-19T16:46:46","date_gmt":"2018-05-19T08:46:46","guid":{"rendered":"https:\/\/drho.club\/?p=2146"},"modified":"2018-05-19T16:46:46","modified_gmt":"2018-05-19T08:46:46","slug":"arduino-stepper-motor","status":"publish","type":"post","link":"https:\/\/104.es\/index.php\/2018\/05\/19\/arduino-stepper-motor\/","title":{"rendered":"\u3010Arduino\u3011\u6b65\u9032\u99ac\u9054\u9a45\u52d5\u5be6\u7fd2"},"content":{"rendered":"<p>\u4e4b\u524d\u6211\u5011\u5df2\u7d93\u64cd\u4f5c\u904e\u4f3a\u670d\u99ac\u9054\u4e86\uff0c\u900f\u904eServo.h\u7a0b\u5f0f\u5eab\u7684\u52a0\u6301\u4ee5\u53caArduino\u677f\u5b50\u4e0a\u63a5\u8173\u7684\u652f\u63f4\uff0c\u5c31\u53ef\u4ee5\u8f15\u6613\u5730\u8b93\u4f3a\u670d\u99ac\u9054\u8f49\u52d5\u5230\u4efb\u610f\u7684\u89d2\u5ea6\uff0c\u800c\u4e14\u662f\u7d55\u5c0d\u7684\u89d2\u5ea6\uff0c\u4e5f\u5c31\u662f\u6211\u5011\u8aaa\u5e7e\u5ea6\u5c31\u662f\u5230\u5e7e\u5ea6\u3002\u7136\u800c\uff0c\u8a71\u96d6\u5982\u6b64\uff0c\u4f46\u662f\u6240\u8b02\u7684\u4efb\u610f\u89d2\u5ea6\u5176\u5be6\u662f\u6709\u9650\u5236\u7684\uff0c\u5927\u90e8\u4efd\u7684\u4f3a\u670d\u99ac\u9054\u53ef\u4ee5\u8a2d\u5b9a\u7684\u89d2\u5ea6\u7bc4\u570d\u90fd\u4ecb\u65bc0\u5230180\u5ea6\u4e4b\u9593\uff0c\u66f4\u4e0d\u7528\u8aaa\u8981\u8f49\u8d85\u904e\u4e00\u5708\u4e86\uff08360\u5ea6\u8f49\u52d5\u7684\u4f3a\u670d\u99ac\u9054\u6c92\u6709\u8fa6\u6cd5\u6307\u5b9a\u7d55\u5c0d\u7684\u89d2\u5ea6\uff0c\u800c\u4e14\u4e5f\u6c92\u6709\u8fa6\u6cd5\u7cbe\u78ba\u5730\u63a7\u5236\u8981\u8f49\u5e7e\u5708\uff09\u3002\u5982\u679c\u6709\u9700\u8981\u7cbe\u78ba\u5730\u8a2d\u5b9a\u8f49\u52d5\u8ef8\u8f49\u52d5\u7684\u5708\u6578\uff0c\u90a3\u9ebc\u5c31\u9700\u8981\u4f7f\u7528\u6b65\u9032\u99ac\u9054\u3002<\/p>\n<p>\u6b65\u9032\u99ac\u9054\u524d\u9032\u7684\u539f\u7406\u4e3b\u8981\u662f\u900f\u904e\u63a7\u5236\u677f\u4f9d\u5e8f\u5730\u50b3\u9001\u9032\u4e0d\u540c\u7684\u8a0a\u865f\u4ee5\u5efa\u7acb\u4e0d\u540c\u7684\u78c1\u789f\u9032\u800c\u8b93\u99ac\u9054\u524d\u9032\u6216\u5f8c\u9000\uff0c\u56e0\u6b64\u9700\u8981\u6709\u4e00\u500b\u63a7\u5236\u677f\u4f86\u5354\u52a9\u6211\u5011\u505a\u9019\u4ef6\u4e8b\uff0c\u96f6\u7d44\u4ef6\u5982\u4e0b\uff1a<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/104.es\/wp-content\/uploads\/2018\/05\/2018-05-19-16.12.57.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2143\" src=\"https:\/\/104.es\/wp-content\/uploads\/2018\/05\/2018-05-19-16.12.57.jpg\" alt=\"\" width=\"600\" height=\"450\" srcset=\"https:\/\/104.es\/wp-content\/uploads\/2018\/05\/2018-05-19-16.12.57.jpg 600w, https:\/\/104.es\/wp-content\/uploads\/2018\/05\/2018-05-19-16.12.57-300x225.jpg 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>\u4e0a\u65b9\u5373\u662f\u9019\u6b21\u5be6\u7fd2\u7684\u6b65\u9032\u99ac\u9054\uff0c\u5b83\u7684\u898f\u683c\u662f28BYJ-48 5V DC\uff0c\u53e6\u5916\u5b83\u6709\u4e00\u500b\u5c08\u7528\u7684\u63a7\u5236\u677f\uff0c\u5169\u8005\u9023\u63a5\u4e4b\u5f8c\u7684\u6a23\u5b50\u5982\u4e0b\uff1a<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/104.es\/wp-content\/uploads\/2018\/05\/2018-05-19-16.13.35.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2145\" src=\"https:\/\/104.es\/wp-content\/uploads\/2018\/05\/2018-05-19-16.13.35.jpg\" alt=\"\" width=\"600\" height=\"450\" \/><\/a><\/p>\n<p>\u4e0a\u5716\u4e0b\u65b9\u6709\u4e00\u500b5&#8211;12V\u7684\u63a5\u8173\uff0c\u5c31\u5982\u540c\u4e4b\u524d\u6211\u5011\u5728\u9023\u63a5\u6240\u6709\u96f6\u7d44\u4ef6\u7684\u65b9\u5f0f\u4e00\u6a23\uff0c\u9019\u88e1\u8981\u7d66\u5b83\u4e00\u500b\u5916\u90e8\u7684\u96fb\u6e90\uff0c\u9084\u662f\u5efa\u8b70\u4f7f\u7528\u653e\u5728\u9eb5\u5305\u677f\u4e0a\u7684\u96fb\u6e90\u6a21\u7d44\u4f9b\u96fb\uff0c\u7136\u5f8c\u5225\u5fd8\u4e86\u9eb5\u5305\u677f\u4e0a\u7684\u8ca0\u532f\u6d41\u6392\u7684\u4f4d\u7f6e\u4e5f\u8981\u9023\u63a5\u4e00\u689d\u5230Arduino\u677f\u5b50\u4e0a\u7684GND\u63a5\u8173\u3002\u63a5\u8457\u8acb\u628aIN1\uff0cIN2\uff0cIN3\uff0c\u4ee5\u53caIN4\u9023\u63a5\u5230Arduino\u4e0a\u76842, 3, 4, 5\uff0c\u4e0d\u8981\u63a5\u932f\u5594\u3002\u9023\u63a5\u5b8c\u7562\u4e4b\u5f8c\uff0c\u5373\u53ef\u4f7f\u7528\u4ee5\u4e0b\u7684\u7a0b\u5f0f\u78bc\u9a45\u52d5\u6b64\u6b65\u9032\u99ac\u9054\u9032\u884c\u6b63\u8f49\u4e00\u5708\u4ee5\u53ca\u53cd\u8f49\u4e00\u5708\u7684\u91cd\u8986\u904b\u4f5c\u3002<\/p>\n<p>[code]<br \/>\n#include &lt;Stepper.h&gt;<\/p>\n<p>Stepper stepper(2048, 2, 4, 3, 5);<\/p>\n<p>void setup() {<br \/>\n  stepper.setSpeed(5);<br \/>\n}<\/p>\n<p>void loop() {<br \/>\n  stepper.step(2048);<br \/>\n  delay(2000);<br \/>\n  stepper.step(-2048);<br \/>\n  delay(2000);<br \/>\n}<\/p>\n<p>[\/code]<\/p>\n<p>\u4ee5\u4e0b\u662f\u4e0a\u8ff0\u7a0b\u5f0f\u57f7\u884c\u4e4b\u5f8c\u99ac\u9054\u904b\u4f5c\u7684\u5f71\u7247\uff1a<br \/>\n<iframe loading=\"lazy\" title=\"Arduino\u6b65\u9032\u99ac\u9054\u5be6\u7fd2\u7bc4\u4f8b\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/SwcxMYX9GE8?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","protected":false},"excerpt":{"rendered":"<p>\u4e4b\u524d\u6211\u5011\u5df2\u7d93\u64cd\u4f5c\u904e\u4f3a\u670d\u99ac\u9054\u4e86\uff0c\u900f\u904eServo.h\u7a0b\u5f0f\u5eab\u7684\u52a0\u6301\u4ee5\u53caArduino\u677f\u5b50\u4e0a\u63a5\u8173\u7684\u652f\u63f4\uff0c\u5c31\u53ef\u4ee5\u8f15\u6613\u5730\u8b93\u4f3a\u670d\u99ac\u9054\u8f49\u52d5\u5230\u4efb\u610f\u7684\u89d2\u5ea6\uff0c\u800c\u4e14\u662f\u7d55\u5c0d\u7684\u89d2\u5ea6\uff0c\u4e5f\u5c31\u662f\u6211\u5011\u8aaa\u5e7e\u5ea6\u5c31\u662f\u5230\u5e7e\u5ea6\u3002\u7136\u800c\uff0c\u8a71\u96d6\u5982\u6b64\uff0c\u4f46\u662f\u6240\u8b02\u7684\u4efb\u610f\u89d2\u5ea6\u5176\u5be6\u662f\u6709\u9650\u5236\u7684\uff0c\u5927\u90e8\u4efd\u7684\u4f3a\u670d\u99ac\u9054\u53ef\u4ee5\u8a2d\u5b9a\u7684\u89d2\u5ea6\u7bc4\u570d\u90fd\u4ecb\u65bc0\u5230180\u5ea6\u4e4b\u9593\uff0c\u66f4\u4e0d\u7528\u8aaa\u8981\u8f49\u8d85\u904e\u4e00\u5708\u4e86\uff08360\u5ea6\u8f49\u52d5\u7684\u4f3a\u670d\u99ac\u9054\u6c92\u6709\u8fa6\u6cd5\u6307\u5b9a\u7d55\u5c0d\u7684\u89d2\u5ea6\uff0c\u800c\u4e14\u4e5f\u6c92\u6709\u8fa6\u6cd5\u7cbe\u78ba\u5730\u63a7\u5236\u8981\u8f49\u5e7e\u5708\uff09\u3002\u5982\u679c\u6709\u9700\u8981\u7cbe\u78ba\u5730\u8a2d\u5b9a\u8f49\u52d5\u8ef8\u8f49\u52d5\u7684\u5708\u6578\uff0c\u90a3\u9ebc\u5c31\u9700\u8981\u4f7f\u7528\u6b65\u9032\u99ac\u9054\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":[103,204],"class_list":["post-2797","post","type-post","status-publish","format-standard","hentry","category-arduino","tag-28byj-48","tag-204"],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/posts\/2797","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=2797"}],"version-history":[{"count":0,"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/posts\/2797\/revisions"}],"wp:attachment":[{"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/media?parent=2797"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/categories?post=2797"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/tags?post=2797"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}