Wow. Please don't bother looking at my code - your "help" is just criticism and cynicism which you clearly get some kind of satisfaction from - i.e. you're a troll.
P.S. That code I posted was just a bare bones basic example that I put together to demonstrate when the issue occurs and when it doesn't. The while(true) is there so the RemoteLib object is instantiated just once (to demonstrate that it works fine in that situation)
P.P.S. "Do your thinking in your own time ..." wtf? I didn't know I was your employee lol
If you cannot take criticism, don't ask questions.
Thicken your Skin.
As Robin2 said: Slow Down. Ask a question, expect responses.
Slow down a bit. Do your thinking in your own time and post your comments when you have the thinking complete.
When you ask a chain of questions it seems you really don't want an answer, you just want to vent.
What if I do this? (insert question here>)
But what if I do this? (insert different question here>)
But I really want to do it this way? (insert example of non working code here>)
And when someone calls out 'bad coding' practices you call them a troll. a troll is someone that calls out mistakes to belittle a poster. Robin2 has valid critiques. The Arduino environment calls the loop() function continously. But every time around the loop() it can do some house keeping. when you put that:
//stay here fore ever!
Some of the Arduino environment will not funtion as expected.
also, the setup() function is by definition called only once after reset, all of your one time initialization code should be called from it.
p.s. no one called you stupid(incapable of learning), you are ignorant (lacking knowledge) get over it and learn.