Pi Zero W freezing up

June 4, 2024, 17:48

riothedev

im using circuitpython on my pi zero w (waiting for my esp32 to arrive) and i've ran into a problem, im making a digital clock and therefore i need a while true loop to update the clock. the problem is running the pi with the while true loop stops all connections with my computer so i cant run any more code on it till i unplug it and plug it back in and it seems to just freeze up after almost a minute or so because the clock just stops counting. could anyone help? thanks in advance

nayab5655

1. Optimize the loop: Make sure the while loop is not blocking the execution of other code. Ensure that there are no long-running operations or delays within the loop that could cause the program to become unresponsive. 2. Use non-blocking methods: If your clock update code involves waiting for certain events or inputs, consider using non-blocking methods or asynchronous programming techniques to avoid blocking the execution of other code.

nayab5655

You can provide me the code so that I can take a better look at it

nayab5655

Give me a ping 👌

riothedev

<@477174925678084096> Asked in the adafruit discord server, seems like circuitpython for pi zero w is still in testing so thats probably the main cause.