I don't see any stepper motor code there. What are you using for a driver ? If you had a chopper type driver it would have two control lines, a STEP and a DIR. If you were using something like an L293 or L298 it would have a total of 4 control lines (A,B,C,D) sometimes referred to as IN1,IN2,IN3, and IN4. In either case two lines are for one coil and the other two lines are for the second coil of the bipolar stepper motor. I don't see anything remotely similar to either in the code you posted.
1- What driver are you using ? (I'm talking about the HARDWARE driver)
2- Have you tested the stepper using the Stepper library example ?
/*
Stepper Motor Control - one step at a time
This program drives a unipolar or bipolar stepper motor.
The motor is attached to digital pins 8 - 11 of the Arduino.
The motor will step one step at a time, very slowly. You can use this to
test that you've got the four wires of your stepper wired to the correct
pins. If wired correctly, all steps should be in the same direction.
Use this also to count the number of steps per revolution of your motor,
if you don't know it. Then plug that number into the oneRevolution
example to see if you got it right.
Created 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);
int stepCount = 0; // number of steps the motor has taken
void setup() {
// initialize the serial port:
Serial.begin(9600);
}
void loop() {
// step one step:
myStepper.step(1);
Serial.print("steps:" );
Serial.println(stepCount);
stepCount++;
delay(500);
}
Note the 4 control pins :
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);
my stepper code runs fine, but HERE IS MY PROGRAM that does not work...
posting code that does work does not give us anyhing to fix.
if you have any delay in your program, get rid of them,
if you have any serial write, comment it out and try again.
What Dave means (but is too tackful to come right out and say ) is :
Your code sucks. (to put it simply , it's garbage (in so far as the stepper motor is concerned. I have no comment about any non-stepper related code there.