• The first code example surprise me a bit by what it should do...

    For ten seconds, every five (5) milliseconds it logs "foo ". On the 1000th time, something after five (5) seconds, it turns the pin on.

    The hanging to me means that something with the buffers goes hi wire, because of all the logging...

    What is the reason for the loop? ...are you trying to reinstate Arduino on an event driven system?

    The second piece of code does it 100 times slower: every 500 milliseconds, it does log something... and the rest of the time it is sleeping. Less than a percent - probably 1/2 a percent as busy as the first code...

    Could it be that the system crashes and reboots?... I would be surprised...

    PS: ...not Espruino hangs, but ESP8266 Wifi stack puts an end to this...?

About

Avatar for allObjects @allObjects started