void loop() {
buttonState=digitalRead(button_pin);
if(buttonState==HIGH){
winding();
buttonState=0;
}
void winding(){
Serial.println("IN");
/*this subprogram should run through until the end, regardless of current button state
* It should be initiated by a single button press and continue to the end
*/
// buttonState=digitalRead(button_pin);
// if (buttonState==HIGH){ //if button has been pressed, proceed
currentMillis=millis();
previousMillis=currentMillis; //get this part to work
if (currentMillis-previousMillis<=10000){//we'll run them all
digitalWrite(ext_ena,LOW);
digitalWrite(wind_ena,LOW);
digitalWrite(mate_ena,LOW);
digitalWrite(main_ena,LOW);
digitalWrite(heat_ena,LOW);
currentMicros=micros();
//see if it's time to make another step
if ((currentMicros - previousMicros_ext)>=microsBetweenSteps_ext){
previousMicros_ext += microsBetweenSteps_ext; //add time
digitalWrite(ext_pul,HIGH);//pulse the stepper
digitalWrite(ext_pul,LOW);
currentMillis=millis();//get new time, necessary?
}