Arduino Mega 8db nema 17 stepper motor L298N driver

Welcome to the forum members!
I want to ask for a Jis help. Gave an Arduino mega, 8 Nema 17 stepper motors (4Wire) and 8 L298N motor drives.
How could I write a program to have 6 motors rotate directly automatically so I can adjust its speed from a pc and 2 motors to scan automatically, adjusting its speed. Thanks in advance too. P



ossibly control the motors separately with a dmx controller.Hello!

The l298 is a really ancient driver. Are you sure that your steppers fits to it? Many steppers can not be operated with the l298.

You should explain a bit more. How do you want to adjust the speed from the PC. Is there programm running and do you know which protocol it uses? What do you mean with 'scan automatically' and who adjusts its speed?

You could use my MobaTools to drive your steppers. There are examples where you can start with.
'Out of the box' MobaTools supports only 6 steppers. But if you don't use other functionality like servos or bulb simulation it can be easily extended to support 8 steppers.

Works with L298N. By scan I mean that 360 rotates to the right, then 360 to the left. Port 9600

for me it also goes off if 6 engines are spinning continuously and 2 back there

how to assign multiple motors? 1 piece works with this code

should it run automatically, dmx and computer control is not important.

at the same time would start ming 8 engines out of 2 engines back there

Please don't post code as an image. Always post it as text within code tags ( the Button </> in the forum editor ).
Or in the IDE go to Edit->Copy for Forum and insert in your post.

The Stepper.h is not suitable to run several steppers at the same time.

/*
Stepper Motor Control - one revolution

This program drives a unipolar or bipolar stepper motor.
The motor is attached to digital pins 8 - 11 of the Arduino.

The motor should revolve one revolution in one direction, then
one revolution in the other direction.

Created 11 Mar. 2007
Modified 30 Nov. 2009
by Tom Igoe

*/

#include <Stepper.h>

const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution
// for your motor

// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);

void setup() {
// set the speed at 60 rpm:
myStepper.setSpeed(60);
// initialize the serial port:
Serial.begin(9600);
}

void loop() {
// step one revolution in one direction:
Serial.println("clockwise");
myStepper.step(stepsPerRevolution);
delay(500);

// step one revolution in the other direction:
Serial.println("counterclockwise");
myStepper.step(-stepsPerRevolution);
delay(500);
}

works separately, I want to start at once

#include <Stepper.h>

const int stepsPerRevolution = 1000;

// initialize the stepper library on pins 8 through 11:
Stepper myStepper (stepsPerRevolution, 8, 9, 10, 11);

void setup () {
// set the speed at 10 rpm:
myStepper.setSpeed (10);
// initialize the serial port:
Serial.begin (9600);
}

void loop () {
// step one revolution in one direction:
Serial.println ("clockwise");
myStepper.step (stepsPerRevolution);

}

Please don't forget the code tags when posting code.

?? I don't see any try to drive more than one stepper. And I told you already, that Stepper.h is not suitable for that.

@mihucz78, your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advise on) your project.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.