LoginSignup
0
0

More than 5 years have passed since last update.

Arduino 28BYJ-48 ULN2003 ステッピングモーター

Last updated at Posted at 2018-12-17

ソースコード

#include <Stepper.h>
#define P1 8
#define P3 9
#define P2 10
#define P4 11

Stepper stepper = Stepper(2048, P1, P2, P3, P4);
void setup()
{
    stepper.setSpeed(10);
    stepper.step(2048);
    stepper.step(-2048);

}


void loop()
{


}

配線

DSC_6158.jpg
IN1~IN4を8~11へ。
後は電源とGND。一応Vinから取った。

別電源とジャンパーについて

DSC_6159.jpg
別に電源を用意する場合はジャンパーを取り外す。
モーター用は5v~12vと書いてある。
ジャンパーを取り外したら外側のピンに5vを入れる。
ArduinoのGNDと別電源のGNDはつなげておくこと。

ジャンパーは電源スイッチ的なことを書いているサイトがあるが注意。そんなはずない。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0