Ive read the variables reference several times, I
ve tried declaring the variable "inbyte" at the top of the code and in the "Loop"
But I still get the "not declared" error, probably missing something obvious, but I can`t see it...
/*
Testing InByte Values
*/
//Test LEDs
void setup() {
for (int thisPin = 2; thisPin < 17; thisPin++) {
pinMode(thisPin, OUTPUT);
// turn the pin on:
digitalWrite(thisPin, HIGH);
delay(100);
// turn the pin off:
digitalWrite(thisPin, LOW);
}
}
void loop() {
// Inbyte Test Start
for (int inByte = 33; inByte < 40; inbyte++) {
//If Start
if (inByte > 32) {
int range = map(inByte, 32, 39, 0, 7);
//Switch Start
switch (inByte) {
case 0:
digitalWrite(2, HIGH);
break;
case 1:
digitalWrite(3, HIGH);
break;
case 2:
digitalWrite(4, HIGH);
break;
case 3:
digitalWrite(5, HIGH);
break;
case 4:
digitalWrite(6, HIGH);
break;
case 5:
digitalWrite(7, HIGH);
break;
case 6:
digitalWrite(8, HIGH);
break;
case 7:
digitalWrite(9, HIGH);
break;
default:
// turn all the LEDs off:
delay(100);
for (int thisPin = 2; thisPin < 17; thisPin++) {
digitalWrite(thisPin, LOW);
}
//LED`s off
}
//Switch end
}
//If end
}
}
//Inbyte Test END