Delay in sensing temperature locks up Photon

@risingtiger, I think you are actually referring to "blocking" rather than "locking up". There are lots of techniques to make your code non-blocking. The examples provided are designed to be very simple to illustrate a particular feature, and non-blocking code would make the example more complicated and not so easy to understand.

Among the techniques that could be used to make the code non-blocking is the use of interrupts (probably not the technique you would use in this particular case), software timers or using a finite state machine (FSM) to design the behaviour of your firmware. There are likely other techniques as well.

There are a couple of threads running right now where you can see someone else designing a FSM:

and