gavspav wrote:After a quick go with interrupts I think my issue may have been called by the input pin bouncing.
Maybe this was triggering a bunch of consecutive routine calls which meant I wasn't getting to the delay(0); quick enough.
Not really sure but no crashes for a while!
I have noticed in some of my own code that delay(0) and delay(1) works completely differently. That is, delay(0) appears to be a synonym for yield() but delay(1) solves issues when yield() will not. I've seen this mentioned in other posts where the github code base was referenced, so maybe give it a try.
Ray