multivariable stepper control

I’ve been working on getting this project done for awhile now and think I finally have it all programmed to work now (haven’t had the ability to test it yet) but feel like there is a better way to write the code ‘cleaner’ but with my limited experience I’m not sure how to do so. I’m trying to write a code that will count signals received and allow for a push button to determine how many signals are received before morning the stepper motor, the stepper motor is controlled by limiting switches. Any input on how to improve this code or errors I’ve made would be appreciated.

#include <AccelStepper.h>

AccelStepper motor(1,7,8); // step pin = 7 dir pin = 8
int uppin = 3;    //pin number for the up button
int downpin = 4;  //pin number for the down button
int signalPin = 5; //pin number to signal stepping

const int ledPin1 = 6; //LED pin for 1st divison 
const int ledPin2 = 9; //LED pin for 2nd divison
const int ledPin3 = 10; //LED pin for 3rd division
const int buttonPin = 11; //pin number selection

int buttonPushCounter = 0; //counter for selection button
int buttonState = 0; //intial button state
int lastButtonState = 0; 

int signalCounter = 0; //counter for signals
int signalState = 0; //intial signal state
int lastsignalState = 0;

void setup() {


  motor.setMaxSpeed(4000);
  motor.setAcceleration(1500);
  motor.setMinPulseWidth(100);
  motor.setCurrentPosition(0);

  pinMode(uppin, INPUT);
  pinMode(downpin, INPUT);
  pinMode(signalPin, INPUT);
  pinMode(buttonPin, INPUT);
  pinMode(ledPin1, OUTPUT);
  pinMode(ledPin2, OUTPUT);
  pinMode(ledPin3, OUTPUT);

  Serial.begin(9600);

}

void loop() {
  (buttonState = digitalRead(buttonPin));
  if (buttonState != lastButtonState){
    if (buttonState == HIGH) {
      buttonPushCounter++;
    }   
  }

  lastButtonState = buttonState; 

  if (buttonPushCounter % 1 == 0){
    digitalWrite(ledPin1, HIGH);
  }                                       // will rotate with every signal 
  else if (buttonPushCounter % 2 == 0){
    digitalWrite(ledPin2, HIGH);
  }                                      // will rotate with every other signal 
  else if (buttonPushCounter % 4 == 0){
    digitalWrite(ledPin3, HIGH);
  }                                     // will rotate every 4th signal
  if(buttonPushCounter >= 5){
    buttonPushCounter = 0;
  }                                    // resets selector after 5 button pushes 
  (signalPin = digitalRead(signalPin));
  if (signalState != lastsignalState) {
    if (signalState == HIGH) {
      signalCounter ++;
    }                                  // reads number of signals received 
  }
  lastsignalState = signalState;

  if (digitalRead(uppin) == HIGH && digitalRead(ledPin1)== HIGH && signalCounter % 1 == 0){         // check if the input is HIGH (button pushed)
    motor.moveTo(75000);             //Set target (absolute position)
    moveup();  		    	 // run the moveup subroutine
  }
  if (digitalRead(uppin) == HIGH && digitalRead(ledPin2)== HIGH && signalCounter % 2 == 0){         // check if the input is HIGH (button pushed)
    motor.moveTo(75000);             //Set target (absolute position)
    moveup();  		    	 // run the moveup subroutine
  }
  if (digitalRead(uppin) == HIGH && digitalRead(ledPin3)== HIGH && signalCounter % 4 == 0){         // check if the input is HIGH (button pushed)
    motor.moveTo(75000);             //Set target (absolute position)
    moveup();  		    	 // run the moveup subroutine
  }
  if (digitalRead(downpin) == HIGH && digitalRead(ledPin1) == HIGH && signalCounter % 1 ==0) {       // check if the input is HIGH (button pushed)
    motor.moveTo(0);                  //Set target (absolute position)
    movedown();  		    	 // run the movedown subroutine
  }  
  if (digitalRead(downpin) == HIGH && digitalRead(ledPin2) == HIGH && signalCounter % 2 == 0) {       // check if the input is HIGH (button pushed)
    motor.moveTo(0);                  //Set target (absolute position)
    movedown();  		    	 // run the movedown subroutine
  }  
  if (digitalRead(downpin) == HIGH && digitalRead(ledPin3) == HIGH && signalCounter % 4 == 0) {       // check if the input is HIGH (button pushed)
    motor.moveTo(0);                  //Set target (absolute position)
    movedown();  		    	 // run the movedown subroutine
  }  

  Serial.println(motor.currentPosition());
}

void moveup() {
  //routine to move the platform up

    while (digitalRead(uppin) == HIGH) {

    if (motor.currentPosition() != 75000) {

      motor.run();
    }

  }
  motor.setSpeed(0);
  motor.moveTo(motor.currentPosition());
}


void movedown() {
  //routine to move the platform down

    while (digitalRead(downpin) == HIGH) {

    if (motor.currentPosition() != 0) {

      motor.run();
    }
  }
  motor.setSpeed(0);
  motor.moveTo(motor.currentPosition()); 
}

I'm trying to write a code that will count signals received and allow for a push button to determine how many signals are received before morning the stepper motor, the stepper motor is controlled by limiting switches.

I recognize all the words. The order doesn't make a lot of sense.

Where are the signals coming from? What, exactly, is the push button supposed to do?

  (buttonState = digitalRead(buttonPin));

(Why) (is) (this) (in) (parentheses) (?)

  if (buttonPushCounter % 1 == 0){
    digitalWrite(ledPin1, HIGH);
  }                                       // will rotate with every signal

When you divide by 1, the remainder is always 0.

  (signalPin = digitalRead(signalPin));

(More) (useless) (parentheses) (.)

void moveup() {
  //routine to move the platform up

    while (digitalRead(uppin) == HIGH) {

    if (motor.currentPosition() != 75000) {

      motor.run();
    }

  }
  motor.setSpeed(0);
  motor.moveTo(motor.currentPosition());
}

I don't see anything about limit switches, here.

You should read and learn more about arrays! http://arduino.cc/en/Reference/Array This can make your code alot smaller :)