User:Jdittman8063/ENES-100/project 1/Quick Test

This code will be for a quick test of the Arduino and motor working with the rest of the project.

include  AF_Stepper motor(200, 2);

int led = 10; //set digital pin to 10

void setup{ Serial.begin(9600);                     // set up Serial library at 9600 bps Serial.println("Stepper test!"); motor.setSpeed(10);                  // 10 rpm motor.step(200, FORWARD, SINGLE); motor.release; delay(1000); }

void loop { for (int a=1; a<2; a++){ for (int b=1; b<2; b++){ for (int c=1; c<4; c++){ //loop through all 64,000 theoretical combinations motor.step((a * 5), FORWARD, DOUBLE); delay(100); motor.step((a * 5), BACKWARD, DOUBLE); delay(100); motor.step((b * 5), BACKWARD, DOUBLE); delay(100); motor.step((c * 5), FORWARD, DOUBLE); delay(500);

//position at zero for next combination motor.step((c * 5), BACKWARD, DOUBLE); delay(100); motor.step((b * 5), FORWARD, DOUBLE); delay(500); //spin 2 full rotations to clear previous combination motor.step((200), FORWARD, DOUBLE); delay(1000); }     }   } }