Reading "ac voltage pressence" using software only.

Conclusion is that this is the code issue. Will post further question in relevant thread.

https://forum.arduino.cc/index.php?topic=549543.0