I have an error message I don't know how to fix my code.

I am trying to make it to where when the potentiometer reads 0-25% the 1st led (leda) turns on, so on and so forth. The only thing is I am a total noob and for case 3 it says "jump to case label [-fpermissive]. I have no idea what that means any help. My code is down below and the problem spot is case 3:

int leda = 7; int ledb = 6; int ledc = 5; int ledd = 4; const int min = 0; const int max = 1023;

void setup() { Serial.begin(9600); int leda(LOW); int ledb(LOW); int ledc(LOW); int ledd(LOW);

}

void loop() { int sensorReading = analogRead(A0); int range = map(sensorReading, min, max, 0, 3); switch (range){ case 0: Serial.println("1st led"); int leda(HIGH); break; case 1: Serial.println("2nd led"); int leda(HIGH); int ledb(HIGH); break; case 2: Serial.println("3rd led"); int leda(HIGH); int ledb(HIGH); int ledc(HIGH); break; case 3: Serial.println("4th led"); int leda(HIGH); int ledb(HIGH); int ledc(HIGH); int ledd(HIGH); break;} }

delay(1);

  int leda(LOW);
  int ledb(LOW);
  int ledc(LOW);
  int ledd(LOW);

Where have you ever seen that syntax? Or do you think you can just make stuff up and the compiler will figure it out for you?

Perhaps you should work through some examples or tutorials and get a clue how these things are supposed to be written.

HINT: writing a pin HIGH or LOW involves the digitalWrite function.

void setup() {
  Serial.begin(9600);
  int leda(LOW);
  int ledb(LOW);
  int ledc(LOW);
  int ledd(LOW);
}

That is passing LOW to the constructor for leda etc.

However these are shadow declarations for leda/b/c/d in global scope. So those lines achieve nothing at all.

Plus what Delta_G said.