Arduino buton ile led kontrol kodları

berk9977

Centipat
Katılım
8 Ocak 2021
Mesajlar
16
Daha fazla  
Cinsiyet
Erkek
Merhaba, arduino öğrenmeye basladım projem buton ile ledi açmak ve bir daha butona basılınca ledi kapatmak evlerimizde kulandıgımız ışıklar gibi. Kodda hata var gozukuyor hata mesajı :
buton_ile__s_k_kontrol:20:3: error: expected '}' at end of input
}
^
exit status 1

expected '}' at end of input

C++:
  #define Led 10
  #define Buton 8
  int buton_durumu = 0;

void setup() {
  pinMode(Buton,INPUT);
  pinMode(Led,OUTPUT);

}

void loop() {
  buton_durumu = digitalRead(Buton);
  if(digitalRead(Buton),HIGH);
  {
  digitalWrite(Led,HIGH);
  }
  if(digitalRead(Buton),LOW);
  {
  digitalWrite(Led,LOW);
  }
 
Son düzenleyen: Moderatör:
Kodun sonuna bir tane daha } koyman gerekiyor. void loop()'a ait süslü parantezi kapatmamışsın.
 

Geri
Yukarı