Is there a way to debug code in Setup? Trying to use a for

You haven't said what is wrong with either version.
But what is the point of "LEDpin = LEDPin"?

Pete