I have a problem. My code for Arduino is:
void count (int a){
if (a == 0) {
int led_pin [4] = {3, 4, 5, 6};
}
else{
int led_pin [2] = {4, 5, 6, 9};
}
for (int i = 0; i <= 7; i++){
digitalWrite(led_pin[i], HIGH);
}
}
and I get output:
'led_pin' was not declared in this scope
How to declared array or change values of array?