Need help with programming

Need help, I am new with arduino.

I would like to do this. Everytime the ls1 (main switch) is HIGH. I would like it to do 2 logic check then output accordingly.

  1. ls1 HIGH, waite 200 millisecond, check ls2, if ls2 is LOW, then turn on led1 for 10 seconds.
  2. ls1 HIGH, and stay HIGH more then 3000 millisecond, then turn on led1 for 5 seconds.

These 2 logic applies at the start of ls1 is HIGH.

below are the code I tried to write but its not doing what I want. new with C programming.

/*     



 */

int ls1= 13;  // Main Switch
int ls2=7;    // Roller
int led1=2;    // LED Light 1 output

// the setup routine runs once when you press reset:
void setup() 
  {          
  pinMode(ls1, INPUT);  
  pinMode(ls2, INPUT);    
  pinMode(led1, OUTPUT); 
  }

void loop() {
{
  if (digitalRead(ls1) == HIGH)
  {
  delay(200);
      if (digitalRead(ls2) == LOW)
      {
      digitalWrite(led1, HIGH);
      delay(10000);
      digitalWrite(led1, LOW);
      }
  }
  else
    {
    digitalWrite(led1, LOW);
    }
}

{
  if (digitalRead(ls1) == HIGH)
  {
  delay(3000);
      if (digitalRead(ls1) == HIGH)
      {
      digitalWrite(led1, HIGH);
      delay(5000);
      digitalWrite(led1, LOW);
      }
  }
  else
    {
    digitalWrite(led1, LOW);
    }
}
}

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.

Your first if is ok but your second if statement should be in the else part of the first because the logic you want can be restated as:

if ls1 input is on for 200ms then
if ls2 is off
turn on led 1
else
wait 2800ms
if ls1 is still on
turn on led1