-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample1.txt
38 lines (33 loc) · 1.14 KB
/
example1.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
Control a bi-polar stepper motor using the SparkFun ProDriver TC78H670FTG
By: Pete Lewis
SparkFun Electronics
Date: July 2nd, 2020
License: MIT. See license file for more information but you can
basically do whatever you want with this code.
This example does a default setup (full step resolution) and turns the motor back and forth.
Feel like supporting open source hardware?
Buy a board from SparkFun! https://www.sparkfun.com/products/16836
Hardware Connections:
ARDUINO --> PRODRIVER
D8 --> STBY
D7 --> EN
D6 --> MODE0
D5 --> MODE1
D4 --> MODE2
D3 --> MODE3
D2 --> ERR
*/
#include "SparkFun_ProDriver_TC78H670FTG_Arduino_Library.h" //Click here to get the library: http://librarymanager/All#SparkFun_ProDriver
PRODRIVER myProDriver; //Create instance of this object
void setup() {
Serial.begin(115200);
Serial.println("SparkFun ProDriver TC78H670FTG Example 1");
myProDriver.begin(); // default settings
}
void loop() {
myProDriver.step(200, 0); // turn 200 steps, CW direction
delay(1000);
myProDriver.step(200, 1); // turn 200 steps, CCW direction
delay(1000);
}