programming guidance needed

Hi.

I'm starting with Arduino and have been messing around not getting enithing serious done. I have couple of projects in mind but before I start I would like to refine my programming practice. The biggest help I need with is making/declaring custom statements or function that can make programming quicker. I have 10 LED's for example. every time I want to light them up or not I need to write out digitalWrite(10, HIGH); digitalWrite(11, HIGH);... all the way and then same to bring them low. what faster way is there to do all at once depending on button press, pot, range sensor etc. How to group them in twos and then use them as a group from that point on? If you could give me an example code, some tips and guidance, I would appriciate it.
I have Arduino Mega.

Thanks,
Edge

Grumpy_Mike's tutorial on arrays will probably help.

awesome! That answers my question.

Edge

edijse:
awesome! That answers my question.

Edge

You may also find it handy to use functions to keep things tidy, especially (but not solely) if you need to the same thing a few times in one sketch.

edijse:
awesome! That answers my question.

Edge

Glad it was useful to you.

Grumpy_Mike:
Glad it was useful to you.

You're welcome :stuck_out_tongue: