I have a mega and I would like to know which pins are safe to use as digital outputs when using the I2C protocol. I have 62 LEDs on a simulation (only one LED lit at a time) and lighting up sequentially. Which pins must I avoid using?
I should have been more explicit; I understand that I can't use those so does that leave every other pin available apart from tx/rx I was worried about using 14,15,16,17 and 18.
If you intend to use the other serial ports, for this project or anything else in future, then don't use those ones, "just in case"; damaging a pin does happen. But if no other serial use is likely, then use them. They're multipurpose, and being a digital output is one of those purposes.
You normally would use a LED driver for that, like the MAX7219.
Those 64-LED chips use three Arduino pins, so you don't even need a Mega.
And they can be daisy-chained, for thousands of LEDs on the same three Arduino pins.
Leo..
Another option you might think about are addressable LEDs - takes 1 Arduino pin and away you go. Look at Neopixels or other strings, combined with FastLED library.
Neat, clean, and multicoloured.
Available in prewired strings, chip-on-board, and 4-pin T5 LED versions(WS2812D). I'm using the latter for model RR control panels.