GPIO Status Display Help!

Good Evening All,

Hardware: ATMEGA 2560, WINC1500 WiFi Shield

I have a working, simple project. I toggle a gpio pin on and off, there’s a significant delay but it works. The issue is, I need to know the status of the toggled gpio pin. I am doing this by reading the toggled gpio pin, send to the cloud, grab from the cloud on a iPhone, and set hide or show of an icon to indicate whether the gpio pin is on or off. This sort of works, but is very inconsistent, when the gpio pin is steady on, the indicator on the app will randomly show and hide. Could somebody give me a proper idea of how to check the status of a toggled gpio pin and display that status over WiFi to my application(iPhone). Thank you in advanced for any time spent helping me out.

Regards,

Tim