Beginner questions regarding motors library

Hi, im a newbie in arduino, and started digging about stepper motors…would appreciate your help in answering some questions :

  1. If you use motors in your projects, do you use libraries like accelstepper etc, or wrote your own library/ code ?

  2. my background is mechanics and electronics, not programming. i tried to understand and use the Accelstepper library with my 28BYJ stepper , without much success, although i read the reference by the library author.
    is there any other explanation/ reference for this library ? i just copy-pasted the simplest example code and it didnt work, the motor just buzzes…what can it be ?

#include <AccelStepper.h>

AccelStepper stepper(AccelStepper::HALF4WIRE,8,9,10,11); // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5

void setup()
{
stepper.setMaxSpeed(1000);
stepper.setSpeed(500);
}

void loop()
{
stepper.runSpeed();
}

  1. If someone could point me to a good coding example of a simple project with stepper motor, will be highly appreciated…

thanks

The complex bit with stepper motors is the physical link between the Arduino board and the stepper. The Arduino can't supply enough current to drive a motor so you need some sort of interface board that can take signals from the Arduino, power from a separate source (batteries or a plug-in power supply) and provide the control signals for the motor.

I have only used the Pololu A4988 stepper driver board which someone said in a recent thread may not be able to control the low currents needed by your motor. The A4988 just needs step and direction inputs from the Arduino and I have written my own code. As far as I can see the AccelStepper library will also work.

All this is leading up to the fact that you need to understand how to wire your driver board to the motor and then how to wire the Arduino to the board. As far as I know AccelStepper is fairly flexible about what Arduino pins it uses - but you need to know what each of them does (in relation to the driver board) to be able to give AccelStepper the correct pin references.

Can you post a link to the driver board you are using and a diagram showing how it is wired?

...R

Robin2: The complex bit with stepper motors is the physical link between the Arduino board and the stepper. The Arduino can't supply enough current to drive a motor so you need some sort of interface board that can take signals from the Arduino, power from a separate source (batteries or a plug-in power supply) and provide the control signals for the motor.

I have only used the Pololu A4988 stepper driver board which someone said in a recent thread may not be able to control the low currents needed by your motor. The A4988 just needs step and direction inputs from the Arduino and I have written my own code. As far as I can see the AccelStepper library will also work.

All this is leading up to the fact that you need to understand how to wire your driver board to the motor and then how to wire the Arduino to the board. As far as I know AccelStepper is fairly flexible about what Arduino pins it uses - but you need to know what each of them does (in relation to the driver board) to be able to give AccelStepper the correct pin references.

Can you post a link to the driver board you are using and a diagram showing how it is wired?

...R

i rechecked the wiring, and found out that in accelstepper the pin sequence is defined 1-3-2-4 and not 1-2-3-4 .. thanks Robin!