Why my function is not calling within a case
because you have a // commenting out the call at the start of the line.. don't you?.... I can't really see...
You realize this is probably the dumbest question of the day, right? how can we know if we don't see your code....
here is a working example. are you using switch/case the right way?
void f1()
{
Serial.println(F("in function 1"));
}
void f2()
{
Serial.println(F("in function 2"));
}
void f3()
{
Serial.println(F("in function 3"));
}
void setup() {
Serial.begin(115200);
byte n = 1;
switch (n) {
case 1:
f1();
break;
case 2:
f2();
break;
default:
f3();
break;
}
}
void loop() {}
For informed help, please read and follow the directions in the "How to use this forum" post.
Ajinkya168:
Why my function is not calling within a case
You are doing something wrong in the sketch you did not show.