Hello
I want to create a program that when i press a button then a led will be litted. Then when a turn it again, an another led will be litted etc.
My idea was to create an array that will contain 8 ledpins (8 LEDS) and 8 ledstates ( if they are High or Low). Then i will use a For loop. When I press the button, then it adds +1 in my variable, i (i++). Finally the program digitalwrite (ledstate{i}, ledpin(i), on so on.
My question is, how can i combine digitalRead and For?