Where did I go wrong?

In this project my relays will open as per the input voltage. In place of relay i am using leds. This is code for any input, led connected to pin 38 is high. All other leds are not getting on with increase in voltage. My connection to leds is correct because i have used http://www.arduino.cc/en/Tutorial/KnightRiderknight rider code to check connection

const int analogInPin = A0;  // Analog input pin that the potentiometer is attached to
int sensorValue = 0;        // value read from the pot
int outputValue = 0;        // value output to the 
int pinArray[] = {38, 39, 40, 41};
int count = 0;

void setup(){
  // we make all the declarations at once
  for (count=0;count<4;count++) {
    pinMode(pinArray[count], OUTPUT);
    digitalWrite(pinArray[count], LOW);
  }
}

void loop() {
  // read the analog in value:
  sensorValue = analogRead(analogInPin);            
  // map it to the range of the analog out:
  outputValue = map(sensorValue, 0, 1023, 0, 125);  
  // change the analog out value:

  
  if(sensorValue = 1)
  { digitalWrite(38, HIGH);
    digitalWrite(39, LOW);
    digitalWrite(40, LOW);
    digitalWrite(41, LOW);
  }

  else if(sensorValue = 2)
  {
    digitalWrite(38, HIGH);
    digitalWrite(39, HIGH);
    digitalWrite(40, LOW);
    digitalWrite(41, LOW);
  }
 
  else if(sensorValue = 3)
  { digitalWrite(38, HIGH);
    digitalWrite(39, HIGH);
    digitalWrite(40, HIGH);
    digitalWrite(41, LOW);
  }
   else if(sensorValue = 4)
  { digitalWrite(38, HIGH);
    digitalWrite(39, HIGH);
    digitalWrite(40, HIGH);
    digitalWrite(41, HIGH);
  }
   delay(2);
   
}

which arduino you have??

??
pin the arduino .................¿¿

int pinArray[] = {38, 39, 40, 41};
pinMode(pinArray[count], OUTPUT);

  if(sensorValue = 1)

What stands out immediately is that = is an assignment not a comparison. You must use == for comparison.
In any case, why do you think that sensor will ever have a value of 1, 2, 3 or 4 ?

Naruto128:
which arduino you have??

Arduino mega Rev3

Naruto128:
??
pin the arduino .................¿¿

int pinArray[] = {38, 39, 40, 41};
pinMode(pinArray[count], OUTPUT);

I used this trick from Knight rider code 8)

UKHeliBob:

  if(sensorValue = 1)

What stands out immediately is that = is an assignment not a comparison. You must use == for comparison.
In any case, why do you think that sensor will ever have a value of 1, 2, 3 or 4 ?

Oh! and expected Sensor value is 1V, 2V......5V

Does analogRead() return voltage though ?

UKHeliBob:
Does analogRead() return voltage though ?

NO i got it i forgot to convert ADC result in voltage =(
any thing else wrong in this code?

There's the unused variable, outputValue

Thank you guys for help. I have rectified all the issues its now up and working. Please excuse me if I frequently ask for help as I am from electronics and telecom background with basic knowledge of programming

AWOL:
There's the unused variable, outputValue

Eliminated it. It was for future use but now no need