Steppers from first principles

I have a bipolar 4-wire stepper that I am trying to make work with an L298-based driver board and all I get is a twitch from the motor. The code I am running is:

#include <Stepper.h>

#define STEPS 200

Stepper stepper(STEPS, 13,12,11,8);

int steps = 0;

void setup() {
  Serial.begin(9600); 
  stepper.setSpeed(10);
  pinMode(10,OUTPUT);
  pinMode(9,OUTPUT);
  digitalWrite(10, HIGH);
  digitalWrite(9, HIGH); 
}

void loop() {
  Serial.println("Going forward");
  stepper.step(STEPS);
  delay(1000);
  Serial.println("Going backward");
  stepper.step(-0.75*STEPS);
  delay(1000);
  
}

One of my approaches to trouble shooting is to ditch the Stepper library and just try sending ‘raw’ signals to the driver. Is it as simple as sending a HIGH to one coil, followed by a HIGH on the other and reverting the original coil to LOW, with appropriate delays? I just want to see if I can get the thing to move a couple of steps.

OK answered my original question but it created another. I found the following example of how to drive a stepper:

void loop() {
  digitalWrite(motorPin1, HIGH);
  digitalWrite(motorPin2, LOW);
  digitalWrite(motorPin3, LOW);
  digitalWrite(motorPin4, LOW);
  delay(delayTime);
  digitalWrite(motorPin1, LOW);
  digitalWrite(motorPin2, HIGH);
  digitalWrite(motorPin3, LOW);
  digitalWrite(motorPin4, LOW);
  delay(delayTime);
  digitalWrite(motorPin1, LOW);
  digitalWrite(motorPin2, LOW);
  digitalWrite(motorPin3, HIGH);
  digitalWrite(motorPin4, LOW);
  delay(delayTime);
  digitalWrite(motorPin1, LOW);
  digitalWrite(motorPin2, LOW);
  digitalWrite(motorPin3, LOW);
  digitalWrite(motorPin4, HIGH);
  delay(delayTime);
}

As I surmised, part of the solution is simply to energize the coils one after another. However, the example has two other steps (pardon the pun), where it looks like the coils are being energized in the opposite direction (reversing the polarity of the magnet). Is the principle here to attract the rotor to a winding, then repel it while attracting it to the next winding at the same time and so forth?

More than you ever wanted to know about how stepping motors work here: http://homepage.cs.uiowa.edu/~jones/step/

You should consider getting a "proper" stepper driver board such as the Pololu a4988. It just needs 2 connections to the Arduino - step and direction. It also controls the maximum current that can go to the stepper so you can supply it with higher voltages to get it to run faster.

...R

Robin2 I just ordered a a4988-based driver but I would still like to see if I can make it work 'the hard way'.