What is wrong with my Variables?

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int aJa = 0;
int aNein = 0;
int aWN = 0;
int Ja = 0;
int Nein = 0;
int WN = 0;
int AntW = 0;

void setup() {
  
lcd.begin(8,2);
lcd.write("lcd  lcd");
lcd.setCursor(0,1);
lcd.write("LCD  LCD");
delay(1000);
lcd.clear();
}

void loop() {
  // put your main code here, to run repeatedly:
lcd.print("Quiz V.1");
lcd.setCursor(0,1);
lcd.print(".0Dustin");
  delay(1000);
  lcd.clear();
  delay(10);
lcd.print("Bist du ");
lcd.setCursor(0,1);
lcd.print("Doof?");
 while ( AntW < 1) {
  if (analogRead(A0) > 200){
    Ja();
  }
  if (analogRead(A1) > 200) {
    WN(); 
  }
  if (analogRead(A2) > 200) {
    Nein();
  }
 }
  if (aJa > 0) {
    Richtig();
  }
  if (aNein > 0) {
    Falsch();
  }
  if (aWN > 0) {
    Komisch();
  }
  
}
void Richtig() {
  lcd.setCursor(0, 0);
  lcd.write("Jawoll R");
  lcd.setCursor(0,1);
  lcd.write("ichtig!");
  int aJa = 0;
  int aNein = 0;
}
void Falsch() {
  lcd.setCursor(0, 0);
  lcd.write("Leider F");
  lcd.setCursor(0,1);
  lcd.write("alsch :(");
  int aJa = 0;
  int aNein = 0;
}
void Komisch() {
  lcd.setCursor(0, 0);
  lcd.write("Das weiß");
  lcd.setCursor(0,1);
  lcd.write("ja Jeder");
  int aWN = 0;
}
void Ja() {
   Ja = Ja + 1;
   AntW = Antw + 1;
   aJa = aJa + 1;
  }

void Nein () {
  int Nein = Nein + 1;
  int AntW = AntW + 1;
  int aNein = aNein + 1;
}

void WN() {
  int WN = WN + 1;
  int AntW = AntW + 1;
  int aWN = aWN + 1;
}

it says
sketch_apr17c:7: error: ‘int Ja’ redeclared as different kind of symbol
sketch_apr17c:9: error: previous declaration of ‘void Ja()’
sketch_apr17c:8: error: ‘int Nein’ redeclared as different kind of symbol
sketch_apr17c:10: error: previous declaration of ‘void Nein()’
sketch_apr17c:9: error: ‘int WN’ redeclared as different kind of symbol
sketch_apr17c:11: error: previous declaration of ‘void WN()’
sketch_apr17c.ino: In function ‘void Ja()’:
sketch_apr17c:79: error: assignment of function ‘void Ja()’
sketch_apr17c:79: error: cannot convert ‘void (*)()’ to ‘void()’ in assignment
sketch_apr17c:80: error: ‘Antw’ was not declared in this scope
‘int Ja’ redeclared as different kind of symbol

Whats wrong?

You have Ja declared as an int and a function. Change one.

Thanks a lot! Almost everything is OK now. This still pops up:

sketch_apr17c.ino: In function 'void fJa()': sketch_apr17c:80: error: 'Antw' was not declared in this scope 'Antw' was not declared in this scope

Hi,
You have integers call Ja then go and declare a function void Ja()

int Ja = 0;

void Ja() {
   Ja = Ja + 1;
   AntW = Antw + 1;
   aJa = aJa + 1;
  }

You need to declare your function names different to your variable names.

Hope this helps… Tom… :slight_smile:

Hi, Can you repost your corrected sketch, good to see most errors gone.

Tom... :)

Variables are case sensitive. Antw != AntW

sketch_apr17c:10: error: expected initializer before '!=' token sketch_apr17c.ino: In function 'void loop()': sketch_apr17c:33: error: 'AntW' was not declared in this scope sketch_apr17c.ino: In function 'void fJa()': sketch_apr17c:80: error: 'AntW' was not declared in this scope sketch_apr17c:80: error: 'Antw' was not declared in this scope expected initializer before '!=' token

Now this is going on :confused:

You weren't supposed to put that in your code. It was to demonstrate the Antw and AntW are not the same variable. One has an upper case 'W' and one has a lower case 'w'.

Ooohhhhhhhh now im feeling stupid... Everything is working now Thanks :D