Double for loop breaks program

Questions and discussion about running MicroPython on a micro:bit board.
Target audience: MicroPython users with a micro:bit.
Post Reply
joshuachu3
Posts: 4
Joined: Fri Jul 17, 2020 6:10 am

Double for loop breaks program

Post by joshuachu3 » Fri Aug 07, 2020 9:33 am

I am trying to create a list using a double for loop, when I run it by itself it works fine, but when I run it with the rest of my code, nothing happens and the REPL in mu editor stops working. When I take the double for loop out and paste the whole list in it also works fine, so the rest of my code is fine. Anyone experienced something like this before?

User avatar
Roberthh
Posts: 2176
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Double for loop breaks program

Post by Roberthh » Fri Aug 07, 2020 10:00 am

Probably the code or RAM usage got too large for that little micro.

joshuachu3
Posts: 4
Joined: Fri Jul 17, 2020 6:10 am

Re: Double for loop breaks program

Post by joshuachu3 » Fri Aug 07, 2020 11:35 am

Hmm yeah that's what I thought but wouldn't it display a memory error if that was the case? Nothing shows up on the display.

User avatar
Roberthh
Posts: 2176
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Double for loop breaks program

Post by Roberthh » Fri Aug 07, 2020 11:49 am

Showing an exception message requires. RAM too. Unless you have reserved some space for that, the device can silently freeze.

Post Reply