Hello I am very new to Arduino programming. I would like to design a program to have a stepper motor take a half-step in one direction and then take a half-step back. The program should do this when a button is pressed. I will provide a code I tried to write up. Please keep in mind that this is my first experience with Arduino. I would really appreciate assistance with this. Thanks in advance!
if you have a 4 wire stepper and 200 steps per rotation, that would be a very small movement.
if you are using a stepper driver, then it is best to follow the specific direction of the driver.
for a simple transistor control of a stepper, you only need to see the button is pressed, then send the sequence to the stepper to move the steps needed, then reverse the order to step the steps in reverse.
This demo illustrates very simple stepper code. With the sort of stepper driver it is written for (i.e. one that takes step and direction signals) it is usually possible to set the microstep size on the driver without needing any input from the Arduino.