Does Arduino keep the state of pin?

Probably used AC coupling where dc is needed.