User:Kmcgiver0970/sketchTwo


 * 1) include 

AF_Stepper motor(200, 2);

void setup { Serial.begin(9600);          // set up Serial library at 9600 bps Serial.println("Stepper test!");

motor.setSpeed(10); // 10 rpm

motor.step(100, FORWARD, SINGLE); motor.release; delay(1000); }

void loop { for (int i = 0; i < 40; i++) { for (int j = 0; j < 40; j++) {   for (int k = 0; k < 40; k++) {     //loop through all 64,00 combinations motor.step((i * 2.5), FORWARD, DOUBLE); delay(500); motor.step((j * 2.5), BACKWARD, DOUBLE); delay(500); motor.step((k * 2.5), FORWARD, DOUBLE); delay(2000); //pull selenoid //check position sensor if / else statement //position at zero for next combination motor.step((k * 2.5), BACKWARD, DOUBLE); delay(2000); //spin 2 full rotations to clear previous combination motor.step((80 * 2.5), FORWARD, DOUBLE); delay(2000); } } } }