Hello everyone!
I am doing something with a for loop and have several pins labeled led1, led2, led3 etc.
What I want to do to is to have a digitalWrite command inside a for loop so that I can have
digitalWrite(ledx, HIGH);
where x is the a number I have given in the for loop. So that if I gave the number 3, x would be 1,2,3 in sequence. This will then turn on led1, 2, and 3. The best way I can think to do this is to add the number x to the word led so that I get the name of my pin ie. "led1" or "led2". How can I do this?
Sorry if this is unclear, I've found this really hard to describe for some reason!
Thanks very much