Protocol for posting extensive questions

As to the ‘why’; I suspect that repeatedly calling that stuff unnecessarily was gobbling up your memory (which is at something of a premium on the rp2040).

One of the more frustrating aspects of microcontrollers is that when you blow up your memory like that, it mostly just stops working rather than giving you any clue :-)

I’ve gotten memory allocation errors reported in Thonny. It may depend on the circumstances causing them though? I was getting them when trying to run two LCD’s on SPI. My Display Buffer was eating up all my RAM. I had to do some trickery to get around it.

On another note, it does get tricky when running multiple devices on a Pico. Especially if they use i2c. Clipping and pasting code from the examples to “your” code can get you duplicate entries for some functions. “import” and “from” for example.
I try to go line by line in the example code, looking to see if its already in my existing code.

I knew I should have kept quiet !!! I have two sets of hardware (Plasma2040, pcf8523 and 4 digit display) which I think are identical. I fired up the second set connected as before to my MacBook Pro running Thonny. I firstly booted the Plasma2040 and copied the “flash-nuke.uf2” file I obtained when first starting to play with the Plasma4040 to RP1-RP2 just to I’ve me a “clean” starting point. I then copied across the “pimoroni-pico v.1.19.12-micropython.uf2” file. I have copied the programme and library files from the known working system and uploaded these to the new hardware. When I run the primary programme “.py” file on the new hardware in Thonny, nothing happens!! None of the “print” checks that I incorporated into the programme appear and there are no error reports either in the Thonny Shell window. I went back to the original set of hardware just to be sure and that is fine. Perhaps the second set of hardware is living in one of Mr Feynman’s famous alternate universe’s !!! Any thoughts as before gratefully received.

As you were! I tried various “uf2” files and eventually found that “1.19.7.-micropython.uf2” worked. Since the application has been (successfully) incorporated into a lamp which will soon be on its way to Japan, I am simply going to leave it on extended test and hope for the best and why the original “uf2” file worked on one set of hardware but not the other can remain a mystery (unless it falls over again!)

Hi Mad Monk
Packing with leading zero for minutes and hours made me think of right alignment. I hate numbers moving left and right on a display as the values change.

n = [1,22,100]
l = len(n)
print("Left aligned - normal")
for i in range(l):
    x = n[i]
    print(str(x) +" %")
# Right aligned
print("\nRight aligned")
for i in range(l):
    x = "  "+ str(n[i]) +" %"   
    print(x[-5:])

Give better looking output

>>> %Run -c $EDITOR_CONTENT
Left aligned - normal
1 %
22 %
100 %

Right aligned
  1 %
 22 %
100 %
>>> 

Thanks Tony for the code snippet!! –