The third last line "switchState++;" keeps coming up as "switchState++; exit status 1 switchState++; was not declared in this scope. I do not understand what is going on or how to fix, please can anyone help?
int switchPin = 2;
int motorPin = 3;
int switchTate = 0;
void setup() {
analogWrite (motorPin, 0) ;
pinMode (13, OUTPUT) ;
digitalWrite (13, LOW) ;
attachInterrupt (0, changeMotor, RISING) ;
}
void loop() {
}
void changeMotor () {
switch (switchState) {
case 0:
analogWrite (motorPin, 75);
digitalWrite (13, HIGH);
break;
case 1:
analogWrite (motorPin 150);
digitalWrite (13, LOW);
break;
case 2:
analogWrite (motorPin, 250);
digitalWrite (13, HIGH);
break;
case 3:
analogWrite (motorPin, 0);
digitalWrite (13, LOW);
}
switchState++;
if (switchState == 4)
switchState = 0;
}