I just wrote my first switch statemen and now Im working on the second but I cannot figure out why I get this error. 'states' was not declared in this case. I am confused because it is just about the same as my first statement so why do I have this?
int state=8;
int mi=9;
int whichone;
int buttonst;
int buttonmi;
void setup()
{
Serial.begin(9600);
pinMode(state, INPUT);
pinMode(mi, INPUT);
buttonst=digitalRead(8);
buttonmi=digitalRead(9);
}
void loop()
{
switch(whichone)
{
case 0:
buttonst=HIGH;
buttonmi=LOW;
states();
break;
case 1:
buttonst=LOW&&buttonmi=HIGH;
mis();
break
}
void states()
{
int states;
Serial.println("state");
delay (500);
}
void mis()
{
int mis;
Serial.println("mi");
delay (500);
}
}
