micro stepper control via switch

I've been trying to get a stepper motor to move 1 step when button is pressed once and move continuously when button is pressed continuously.

I've seen a few sketches that control a stepper via a potentiometer.

I thought this would be a good project to learn about steppers as ive never used them before.

I think the 2nd example in this Simple Stepper Code does what you want.

...R
Stepper Motor Basics

Would this work if i wanted to control the micro stepper direct from the arduino.

ullisees:
Would this work if i wanted to control the micro stepper direct from the arduino.

Without knowing what you mean by "this" or by "micro stepper" or by "direct from arduino" I cannot help.

Post a link to the datasheet for your stepper motor.

...R

This is the stepper i plan to use.

X27_Flyer_v1.3.pdf (1020 KB)

That's a bit smaller than the usual ones that are controlled by an Arduino :slight_smile:

If the coil resistance is 230 ohms it would draw a max of 22 mA at 5volts so it could be driven direct from the Arduino I/O pins. What I don't know is whether it might produce back-emf spikes sufficent to damage an Arduino.

The code I linked to assumed that you would use a stepper driver such as a Pololu A4988 which would be like an elephant compared to your mouse.

Assuming there is no electrical problem the AccelStepper library should be able to control the motor.

...R