led control pannel

this is what i have , what am i doing wrong, (low battery so im trying to be breif and t the point)

byte analogPin0 = A0;    // pin that the sensor is attached to
byte analogPin1 = A1;    // pin that the sensor is attached to
byte analogPin2 = A2;    // pin that the sensor is attached to
byte analogPin3 = A3;    // pin that the sensor is attached to
byte analogPin4 = A4;    // pin that the sensor is attached to
byte analogPin5 = A5;    // pin that the sensor is attached to  
byte digitalPin12 = 12;    // pin that the sensor is attached to
byte digitalPin13 = 13;    // pin that the sensor is attached to
int led0 = 2;
int led1 = 3;
int led2 = 4;
int led3 = 5;
int led4 = 6;
int led5 = 7;
int led6 = 8;
int led7 = 9;
int led8 = 10;
int led9 = 11;

// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pin as an output.
  pinMode(led0, OUTPUT);     
  pinMode(led1, OUTPUT); 
  pinMode(led2, OUTPUT);
  pinMode(led3, OUTPUT);     
  pinMode(led4, OUTPUT); 
  pinMode(led5, OUTPUT);
  pinMode(led6, OUTPUT);   
  pinMode(led7, OUTPUT);  


  // initialize serial communications:
  Serial.begin(9600); 
}

void loop() {
  // read the value of the potentiometer:
  byte patternOne = digitalRead(analogPin0);
  byte patternTwo = digitalRead(analogPin1);
  byte patternThree = digitalRead(analogPin2);
  byte patternFour = digitalRead(analogPin3);
  byte patternFive = digitalRead(analogPin4);
  byte patternSix = digitalRead(analogPin5);
  byte patternSeven = digitalRead(digitalPin12);
  byte patternEight = digitalRead(digitalPin13);

if (digitalRead(patternOne) == LOW){
patternIndex = 1;
}
if (digitalRead(PatternTwo) == LOW){
patternIndex = 2;
}
if (digitalRead(patternThree) == LOW){
patternIndex = 3;
} 
}

 switch(patternIndex){
case 1:
    digitalWrite(2, HIGH); 
 digitalWrite(3, LOW);
 digitalWrite(4, LOW);
 digitalWrite(5, LOW); 
 digitalWrite(6, HIGH);
 digitalWrite(7, LOW);
 digitalWrite(8, LOW);
 digitalWrite(9, LOW);
;delay(200);
break;

case 2:
 digitalWrite(2, HIGH); 
 digitalWrite(3, LOW);
 digitalWrite(4, LOW);
 digitalWrite(5, LOW); 
 digitalWrite(6, HIGH);
 digitalWrite(7, LOW);
 digitalWrite(8, LOW);
 digitalWrite(9, LOW);
;delay(200);
break;

case 3:
 digitalWrite(2, HIGH); 
 digitalWrite(3, LOW);
 digitalWrite(4, LOW);
 digitalWrite(5, LOW); 
 digitalWrite(6, HIGH);
 digitalWrite(7, LOW);
 digitalWrite(8, LOW);
 digitalWrite(9, LOW);
;delay(200);
break;
} //end switch:case
} // end loop

and the error

sketch_jul25a.ino: In function 'void loop()': sketch_jul25a:49: error: 'patternIndex' was not declared in this scope sketch_jul25a:51: error: 'PatternTwo' was not declared in this scope sketch_jul25a:52: error: 'patternIndex' was not declared in this scope sketch_jul25a:55: error: 'patternIndex' was not declared in this scope sketch_jul25a.ino: At global scope: sketch_jul25a:59: error: expected unqualified-id before 'switch' sketch_jul25a:96: error: expected declaration before '}' token

I don't see a definition of patternIndex anywhere

Edit:

Also, C is case sensitive, so patternTwo is not the same as PatternTwo.

okay how do i define it,

heres the situation i want to replicate,

i have asets of lights and patterns preset for each of the pattern pins,

I hit a momentary switch and it goes to that pattern.

I hit a diffrent momentary switch and it changes that THAT pattern, only

set up 2 i want to have a momentary 2 way switch that when pushed one way cycles though all the patterns one at a time, each press moves to the next pattern, and the other way to do the same but in reverse order.

i have been getting help and i sorta understand the language but its the smaller things like Booleans i dont know .

You have an errant right curly bracket after patternIndex = 3. It closes loop() so pattern index is out of scope in the part where it is used.

Near the beginning

int patternIndex;

okay im slowly getting the hang of this . difference between a byte and an int?

okay i got it working awesome thanks

A byte is 8 bits and can hold values from 0 to 255. An int is 16 bits and can hold value from -32768 to 32767. Unsigned int holds 0 to 65535.

For your needs, they can all be byte. I define all my variables in the pre-setup area, with the pin definitions.