Reading "ac voltage pressence" using software only.

I am aware of that. This will not be long term solution.

But for the sake of coding I will use this until I manage to understand what I need to do.