Hi
I am completely new to Arduino and electronics at all, and therefore have i ran in to some problems in connecting an Arduino Uno and the Seeedstudio L298 Dual H-brigde and a bipolar stepping motor.
Currently i have connected the 1I to pin 8, 2I to pin 9, 3I to pin10 and 4I to pin 11.
The signal EA is connected to pin2, and EB to pin3.
Basically its:
//H-Bridge pins
int. I1 pin 8
int. I2 pin 9
int. I3 pin 10
int. I4 pin 11
int speed. EB pin 4 //PWM
int speed EA pin 2 //PWM
The Arduino Sample that i have loaded on to my Arduino is the sample sketch from the library.
/*
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);
}
I know that this input is not enough but I don’t know how to write a proper program… so basically my question is: Is this setup correct and how could i alter the sketch so it fits my purpose, which basically is to make to motor spin 60 steps oneway and then 60 steps back the other way.
I apologize if theres any misspellings or sentences which are hard to understand since english is not my native language.
Best regards Mathias.
The H-brigde:
robotshop.com/eu/content/PDF … 103b1m.pdf
Stepping motor:
reprap.org/mediawiki/images/a/af … torque.pdf
it’s a 42mm high torque hybrid stepping motor, with a step angle of 1.8 degrees.
Arduino Uno:
store.arduino.cc/eu/index.php?ma … cts_id=195