I am using the SF example code:
there seems to be a limit of much code can be pasted so lets start with this one, thanks
here is Example5_RunContinuously.ino
/******************************************************************************
Given a speed, run continuously. No acceleration, just GO.
Priyanka Makin @ SparkFun Electronics
Original Creation Date: January 10, 2020
SparkFun labored with love to create this code. Feel like supporting open source hardware?
Buy a board from SparkFun! https://www.sparkfun.com/products/15951
This code is Lemonadeware; if you see me (or any other SparkFun employee) at the
local, and you’ve found our code helpful, please buy us a round!
Hardware Connections:
Attach RedBoard to computer using a USB cable.
Connect Qwiic Step to Red Board using Qwiic cable.
Connect stepper motor to Qwiic Step using latching terminals.
Connect power supply (8-35V) to barrel jack or using latching terminals.
Open Serial Monitor at 115200 baud.
Distributed as-is; no warranty is given.
******************************************************************************/
#include “SparkFun_Qwiic_Step.h” //Click here to get the library: http://librarymanager/All#Qwiic_Step by SparkFun
QwiicStep motor;
void setup()
{
Serial.begin(115200);
Serial.println(“Qwiic step examples”);
Wire.begin();
//Check if Qwiic Step is correctly connected to I2C
if (motor.begin() == false)
{
Serial.println(“Device did not acknowledge! Freezing.”);
while (1)
;
}
Serial.println(“Motor acknowledged.”);
motor.modeRunContinuous(); //Tell the motor to run at the given speed… forever
//Continual running at speed:
//Speeds are in steps per second.
//Positive is clockwise, negative is counter clockwise.
//Speeds of more than 1000 are unreliable.
//Decimal values are allowed. 0.1 = 1 step every ten seconds.
motor.setSpeed(-350);
}
void loop()
{
}