need help fast

there is a time while the power is ON and before the Arduino is ready to take control as mentioned in post #1

I call this the POST; power-on-self-test as left over my PC jargon.

things are out of control because there is no control. things can go on and off like magic or annoying bugs.

one way is to never power off your Arduino.
another is to have a time delay when there is no power to any external things while the Arduino is in this POST condition.
yet another is to output fixed values using some device, and then once the Arduino is up, it can either shut off that device, bypass it, feedback on it, or whatever clever means you come up with.

to repeat. things are out of control, because there is no control.
you cannot control a thing that has no control.
without control, there is no way to control a thing.

so, what you have is a wish that if you do not disturb a thing, that it will not change. this is not control.

if you have no signal when there is no power
and your desired setting is no output when there is power
When you shut off power you have no control.
Although your condition is met, there is no control.

this works in the hobby world, but not in factory automation or most of the real world applications. if you want to control the output, you add a circuit to control it. many of us have scars, either on on hands or memories, of circuits without power being applied.