{"id":532,"date":"2015-04-19T02:47:41","date_gmt":"2015-04-18T17:47:41","guid":{"rendered":"https:\/\/hack.gpl.jp\/?p=532"},"modified":"2015-04-19T02:47:41","modified_gmt":"2015-04-18T17:47:41","slug":"easydriver","status":"publish","type":"post","link":"https:\/\/hack.gpl.jp\/2015\/04\/19\/easydriver.html","title":{"rendered":"EasyDriver"},"content":{"rendered":"

1\u500b160\u5186\u304f\u3089\u3044\u306eEasyDriver\u3092\uff13\u3064\u30b2\u30c3\u30c8\u3057\u3066\u3001\u307e\u305a\u306f\uff11\u3064\u3092\u534a\u7530\u4ed8\u3051\u3002<\/p>\n

\"IMG_0138\" <\/p>\n

\u30d6\u30ec\u30c3\u30c9\u30dc\u30fc\u30c9\u3082\u65b0\u8abf\u3057\u307e\u3057\u305f\uff01 \u524d\u4f7f\u3063\u3066\u305f\u306e\u304c\u3001\u30d4\u30f3\u304c\u3081\u3061\u3083\u304f\u3061\u3083\u5165\u308a\u306b\u304f\u304f\u3066\u3002\u4eca\u5ea6\u306e\u306f\u3001\u3044\u3044\u3067\u3059\u306d\u3002\u633f\u3057\u3084\u3059\u304f\u3066\u30a4\u30e9\u30a4\u30e9\u3057\u306a\u3044\u3002\u3067\u3001\u3053\u3093\u306a\u611f\u3058\u306b\u5dee\u3057\u8fbc\u3093\u3067\u534a\u7530\u4ed8\u3051\u3002<\/p>\n

\"IMGP0825\" <\/p>\n

\u3067\u3001\u30b9\u30c6\u30c3\u30d4\u30f3\u30b0\u30e2\u30fc\u30bf\u30fc\u3092\u7528\u610f\u3057\u3066\u306a\u304b\u3063\u305f\u306e\u3067\u3001\u30d5\u30ed\u30c3\u30d4\u30fc\u30c7\u30a3\u30b9\u30af\u304b\u3001CD-ROM\u3092\u5206\u89e3\u3057\u3066\u30b9\u30c6\u30c3\u30d4\u30f3\u30b0\u30e2\u30fc\u30bf\u30fc\u3092\u53d6\u308a\u51fa\u3059\u3053\u3068\u306b\u3002<\/p>\n

 <\/p>\n

Junk\u7269\u8272\u4e2d\u3002\u914d\u7dda\u4e2d\u3001\u3001\u3001\u3001\u5b8c\u4e86\u3002\u63a5\u7d9a\u3002\u3001\u3001\u3001\u3001\u3046\u3054\u304d\u307e\u305b\u3093\u3002\uff01\uff01\uff01<\/p>\n

 <\/p>\n

\u5bdd\u308b\uff01<\/p>\n

 <\/p>\n

\u30fb\u30fb\u30fb \u8d77\u5e8a\u5f8c\u3001\u3075\u3068\u898b\u308b\u3068EasyDriver \u5074\u306eLED\u304c\u3064\u3044\u3066\u3044\u306a\u3044\u306e\u3092\u767a\u898b\u3002\u96fb\u6e90\u304c\u5165\u3063\u3066\u3044\u307e\u305b\u3093\u3067\u3057\u305f\u3002<\/p>\n

\"\u5199\u771f_1\" <\/p>\n

\uff15V\u3092\u30e2\u30fc\u30bf\u30fc\u30c9\u30e9\u30a4\u30d6\u7528\u306b\u5165\u308c\u3066\u3044\u305f\u3093\u3067\u3059\u304c\u3001\u4ed5\u69d8\u7684\u306b\u30016\uff5e30V\u3068\u304b\u66f8\u3044\u3066\u3042\u308b\u306e\u3067\u3001\u624b\u6301\u3061\u306b8V\u304f\u3089\u3044\u306e\u3057\u304b\u306a\u304b\u3063\u305f\u306e\u3067\u3001\u305d\u308c\u3092\u5370\u52a0\u3002<\/p>\n

\u30b5\u30f3\u30d7\u30eb\u306f\u3001\u30cd\u30c3\u30c8\u3067\u898b\u305f\u306e\u3092\u30b3\u30d4\u30da\u3002PIN\u306e\u30a2\u30b5\u30a4\u30f3\u306f\u3001PIN2 \u306b Direction (\u6b63\u9006\u306e\u56de\u8ee2\u65b9\u5411)\u3068\u3001PIN3 \u306bStep \u30d1\u30eb\u30b9\u3092\u3002<\/p>\n

\"\u5199\u771f_2\" <\/p>\n

\u307b\u307b\u30fc\u3001\u306a\u611f\u3058\u3067\u3059\u3002\u4ed6\u306b\u3082Pin\u304c\u3042\u308b\u3051\u3069\u3082\u3001\u6df1\u8ffd\u3044\u305b\u305a\u3002Sleep \u3068\u304b PFD \u3068\u304b\u4f55\u306b\u4f7f\u3046\u3093\u3067\u3057\u3087\u3046\u304b\u306d\u3002\"\u5199\u771f <\/p>\n

 <\/p>\n

\/*\n Junk FDD Stepper Motor Control Sample.\n JunkHack 2015.04.19\n *\/\n \n#include <Stepper.h>\nint steps;                \/\/ \u30b9\u30c6\u30c3\u30d7\u30ab\u30a6\u30f3\u30bf\u30fc\nint movement = 1400;            \/\/ \u7247\u9053\u79fb\u52d5\u91cf ( step \u6570)\nint Delay = 200;            \/\/ \u9045\u5ef6 ms\nint dirPin = 2;                \/\/ \u56de\u8ee2\u65b9\u5411\u51fa\u529b Pin \nint stepPin = 3;            \/\/ \u30b9\u30c6\u30c3\u30d7\u30d1\u30eb\u30b9 Pin\n\nvoid setup() {                \n  pinMode(dirPin, OUTPUT);        \/\/ \u56de\u8ee2\u65b9\u5411\u306e\u51fa\u529bPIN\u3092\u6307\u5b9a\n  pinMode(stepPin, OUTPUT);        \/\/ \u30b9\u30c6\u30c3\u30d7\u51fa\u529bPIN\u3092\u6307\u5b9a\n  digitalWrite(dirPin, LOW);        \/\/ PIN\u51fa\u529b\u3092LOW\u3067\u521d\u671f\u5316\n  digitalWrite(stepPin, LOW);        \/\/ PIN\u51fa\u529b\u3092LOW\u3067\u521d\u671f\u5316\n  steps = 1;                \/\/ \u30b9\u30c6\u30c3\u30d7\u30ab\u30a6\u30f3\u30bf\u30fc\u3092\u521d\u671f\u5316\n}\n\nvoid loop() {\n  if ( steps < movement ) {        \/\/ \u79fb\u52d5\u91cf\u3092\u8d85\u3048\u3066\u306a\u3051\u308c\u3070\n      digitalWrite(dirPin, HIGH);    \/\/ \u56de\u8ee2\u65b9\u5411\u51fa\u529bPIN \u306f HIGH (5V)\n  } \n  if ( steps > movement  ) {    \/\/ \u79fb\u52d5\u91cf\u3092\u8d85\u3048\u305f\u3089\n      digitalWrite(dirPin, LOW);    \/\/  \u56de\u8ee2\u65b9\u5411\u51fa\u529bPIN \u3092 LOW (0V)\n  }\n  digitalWrite(stepPin, HIGH);        \/\/ \u30b9\u30c6\u30c3\u30d7\u51fa\u529b PIN \u3092 HIGH (5V)\n  delayMicroseconds(Delay);        \/\/ \u9045\u5ef6\n  digitalWrite(stepPin, LOW);        \/\/ \u30b9\u30c6\u30c3\u30d7\u51fa\u529b PIN \u3092 LOW (0V)\n  delayMicroseconds(Delay);        \/\/ \u9045\u5ef6\n  steps += 1;                \/\/ \u30b9\u30c6\u30c3\u30d7\u30ab\u30a6\u30f3\u30bf\u30fc\u3092 +1\u52a0\u7b97\n  if ( steps > movement * 2 ) {    \/\/ \u5f80\u5fa9\u3057\u305f\u3089\n     steps = 1;                        \/\/ \u30b9\u30c6\u30c3\u30d7\u30ab\u30a6\u30f3\u30bf\u30fc\u30ea\u30bb\u30c3\u30c8\n  }\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"

1\u500b160\u5186\u304f\u3089\u3044\u306eEasyDriver\u3092\uff13\u3064\u30b2\u30c3\u30c8\u3057\u3066\u3001\u307e\u305a\u306f\uff11\u3064\u3092\u534a\u7530\u4ed8\u3051\u3002 \u30d6\u30ec\u30c3\u30c9\u30dc\u30fc\u30c9\u3082\u65b0\u8abf\u3057\u307e\u3057\u305f\uff01 \u524d\u4f7f\u3063\u3066\u305f\u306e\u304c\u3001\u30d4\u30f3\u304c\u3081\u3061\u3083\u304f\u3061\u3083\u5165\u308a\u306b\u304f\u304f\u3066\u3002\u4eca\u5ea6\u306e\u306f\u3001\u3044\u3044\u3067\u3059\u306d\u3002\u633f\u3057\u3084\u3059\u304f\u3066\u30a4\u30e9\u30a4\u30e9\u3057\u306a\u3044\u3002\u3067\u3001\u3053\u3093 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","footnotes":""},"categories":[6,9],"tags":[],"acf":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"post-thumbnail":false},"uagb_author_info":{"display_name":"JunkHack","author_link":"https:\/\/hack.gpl.jp\/author\/junkhack\/"},"uagb_comment_info":0,"uagb_excerpt":"1\u500b160\u5186\u304f\u3089\u3044\u306eEasyDriver\u3092\uff13\u3064\u30b2\u30c3\u30c8\u3057\u3066\u3001\u307e\u305a\u306f\uff11\u3064\u3092\u534a\u7530\u4ed8\u3051\u3002 \u30d6\u30ec\u30c3\u30c9\u30dc\u30fc\u30c9\u3082\u65b0\u8abf\u3057\u307e\u3057\u305f…","_links":{"self":[{"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/posts\/532"}],"collection":[{"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/comments?post=532"}],"version-history":[{"count":0,"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/posts\/532\/revisions"}],"wp:attachment":[{"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/media?parent=532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/categories?post=532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/tags?post=532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}