We start with lcd on, then take a look at loop speed in realtime while sending tons of data to lcd, next we go ahead and pull the lcd power line, then goto the monitor to see what happens. the "timeout" is printed by the library during debugging, as you see, during this tineout, the main loop didnt do any random printing of digits to the serial monitor. this resulted in the whole loop being flatlined and unresponsive. as you see in the debugging, after the timeouts accumulated to the limit consecutively, the library shut itself off and there was no more genie processing being done, at all, and restored full functionality of the mcu, we didnt even need to disable any writeobjects or readobjects in your sketch, they are simply ignored until the library "wakes up". This is all inline and automatic and doesnt need you to implement extra code in your sketch either. I then go and connect the lcd, notice the loop is still running full speed while all genie reads or writes are ignored. the lcd will show no movement while loop still runs uninterrupted. Great. I setup a digitalRead as an example to trigger the library wakeup, once i grounded the pin, library woke up and immediately started showing data! 
https://www.youtube.com/watch?v=C4WA...ature=youtu.be
the self-disable-library will look for consecutive timeouts, one after the next, if you had a timeout here or there that was just a glitch, no problem, the moment the link gets idle or a response without a timeout on next command, the counter is reset automatically, so unless it times out 20 times *in a row* it wont disable itself.
Without this the library will do an internal timeout error stock 1sec interval, mod 100ms intervals, blocking, and your loop cycle will drop exponentially, if not creep to a total stop. This is a great solution if I ever need to take the lcd out for programming without having my project creep to a total stop because it's not connected.

https://www.youtube.com/watch?v=C4WA...ature=youtu.be
the self-disable-library will look for consecutive timeouts, one after the next, if you had a timeout here or there that was just a glitch, no problem, the moment the link gets idle or a response without a timeout on next command, the counter is reset automatically, so unless it times out 20 times *in a row* it wont disable itself.
Without this the library will do an internal timeout error stock 1sec interval, mod 100ms intervals, blocking, and your loop cycle will drop exponentially, if not creep to a total stop. This is a great solution if I ever need to take the lcd out for programming without having my project creep to a total stop because it's not connected.


Comment