---
# System prepended metadata

title: ULN2003驅動板+28BYJ-48步進馬達
tags: [28BYJ-48, Arduino]

---

###### tags: `Arduino` `28BYJ-48`
# ULN2003驅動板+28BYJ-48步進馬達
Unistep2.h library can be found in the  in the 
```cpp=
#include <Unistep2.h>

Unistep2 stepper(8, 9, 10, 11, 360, 1000);  //IN1, IN2, IN3, IN4, 總step數, 每步的延遲(in micros)
Unistep2 stepper2(4, 5, 6, 7, 360, 1000);   //IN1, IN2, IN3, IN4

void setup(){}

void loop(){
  stepper.run();  //步進機啟動
  stepper2.run();

  if ( stepper.stepsToGo() == 0 && stepper2.stepsToGo() == 0){ // 如果stepsToGo=0，表示步進馬達已轉完應走的step了
    delay(500);
    stepper.move(360);    //正轉一圈
    stepper2.move(360);
  }
}
```
ref [傑森創工](https://blog.jmaker.com.tw/uln2003-28byj-48/)