user61297: int LDR_deger = 0;

int Ledpin1 = 12;
int Ledpin2 = 11;
int Ledpin3 = 10;
int Ledpin4 = 9;
int Ledpin5 = 8;

int LDR_pin = 0;

void setup()
{

  Serial.begin(9600);
  pinMode(Ledpin1, OUTPUT);
  pinMode(Ledpin2, OUTPUT);
  pinMode(Ledpin3, OUTPUT);
  pinMode(Ledpin4, OUTPUT);
  pinMode(Ledpin5, OUTPUT);
}
void loop()

{
  LDR_deger = analogRead(LDR_pin);
digitalWrite(Ledpin1,HIGH);
digitalWrite(Ledpin2,HIGH);
digitalWrite(Ledpin3,HIGH);
digitalWrite(Ledpin4,HIGH);
digitalWrite(Ledpin5,HIGH);

if (LDR_deger <= 80 && LDR_deger> 30) {
  digitalWrite(Ledpin1, LOW);
} else{
  digitalWrite(Ledpin1, HIGH);
  if (LDR_deger<= 150 && LDR_deger > 80){
  digitalWrite(Ledpin2, LOW);
  digitalWrite(Ledpin1, LOW);
  }else{
    digitalWrite(Ledpin1, HIGH);
    digitalWrite(Ledpin2, HIGH);
    if (LDR_deger  <= 200 && LDR_deger> 150){
      digitalWrite(Ledpin2, LOW);
      digitalWrite(Ledpin1, LOW);
      digitalWrite(Ledpin3, LOW);
     }else{
      digitalWrite(Ledpin1, HIGH);
      digitalWrite(Ledpin2, HIGH);
      digitalWrite(Ledpin3, HIGH);
      if (LDR_deger <= 1000 && LDR_deger> 300){
      digitalWrite(Ledpin2, LOW);
      digitalWrite(Ledpin1, LOW);
      digitalWrite(Ledpin3, LOW);
      digitalWrite(Ledpin4, LOW);
      digitalWrite(Ledpin5, LOW);
     }else{
      digitalWrite(Ledpin1, HIGH);
      digitalWrite(Ledpin2, HIGH);
      digitalWrite(Ledpin3, HIGH);
      digitalWrite(Ledpin4, HIGH);
      digitalWrite(Ledpin5, HIGH);
     }
       }
     }
   } 
  }
Serial.print("LDR Deger: ");
Serial.print(LDR_deger);
Serial.println(" ");
delay(500);
}


user37523: One reason you are receiving the compile error, is due to the code outside of a function. When you write nice, neat, properly formatted code, these errors are easy to spot. The Arduino IDE has a built in feature that will "highlight" a matching curly bracket (or curly brace?).



61297: 

<pre class="lang-cpp prettyprint-override"><code>int LDR_deger = 0;

int Ledpin1 = 12;
int Ledpin2 = 11;
int Ledpin3 = 10;
int Ledpin4 = 9;
int Ledpin5 = 8;

int LDR_pin = 0;

void setup()
{

  Serial.begin(9600);
  pinMode(Ledpin1, OUTPUT);
  pinMode(Ledpin2, OUTPUT);
  pinMode(Ledpin3, OUTPUT);
  pinMode(Ledpin4, OUTPUT);
  pinMode(Ledpin5, OUTPUT);
}
void loop()

{
  LDR_deger = analogRead(LDR_pin);
digitalWrite(Ledpin1,HIGH);
digitalWrite(Ledpin2,HIGH);
digitalWrite(Ledpin3,HIGH);
digitalWrite(Ledpin4,HIGH);
digitalWrite(Ledpin5,HIGH);

if (LDR_deger &lt;= 80 &amp;&amp; LDR_deger&gt; 30) {
  digitalWrite(Ledpin1, LOW);
} else{
  digitalWrite(Ledpin1, HIGH);
  if (LDR_deger&lt;= 150 &amp;&amp; LDR_deger &gt; 80){
  digitalWrite(Ledpin2, LOW);
  digitalWrite(Ledpin1, LOW);
  }else{
    digitalWrite(Ledpin1, HIGH);
    digitalWrite(Ledpin2, HIGH);
    if (LDR_deger  &lt;= 200 &amp;&amp; LDR_deger&gt; 150){
      digitalWrite(Ledpin2, LOW);
      digitalWrite(Ledpin1, LOW);
      digitalWrite(Ledpin3, LOW);
     }else{
      digitalWrite(Ledpin1, HIGH);
      digitalWrite(Ledpin2, HIGH);
      digitalWrite(Ledpin3, HIGH);
      if (LDR_deger &lt;= 1000 &amp;&amp; LDR_deger&gt; 300){
      digitalWrite(Ledpin2, LOW);
      digitalWrite(Ledpin1, LOW);
      digitalWrite(Ledpin3, LOW);
      digitalWrite(Ledpin4, LOW);
      digitalWrite(Ledpin5, LOW);
     }else{
      digitalWrite(Ledpin1, HIGH);
      digitalWrite(Ledpin2, HIGH);
      digitalWrite(Ledpin3, HIGH);
      digitalWrite(Ledpin4, HIGH);
      digitalWrite(Ledpin5, HIGH);
     }
       }
     }
   } 
  }
Serial.print("LDR Deger: ");
Serial.print(LDR_deger);
Serial.println(" ");
delay(500);
}
</code></pre>
 37523: <p>One reason you are receiving the compile error, is due to the code outside of a function. When you write nice, neat, properly formatted code, these errors are easy to spot. The Arduino IDE has a built in feature that will "highlight" a matching curly bracket (or curly brace?).</p>

<p><a href="https://i.stack.imgur.com/G4uKq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/G4uKq.png" alt="enter image description here"></a></p>

<p><a href="https://i.stack.imgur.com/eh5hw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eh5hw.png" alt="enter image description here"></a></p>
