Changing OLED Display with a Single Button

Hi everyone, looking for some help and guidance on a little project I have been working on.

I am trying to use a single button to change the display on an OLED screen, each of the screens has moving elements which is what is causing the problems.

I can get the screen been to change on a button press but it will only loop once then stops.

I really want to have the display continually loop until the next one is selected.

I have tried with Single Click, Double Click, Long Hold and Click & Hold but no matter what I have tried they all just loop once then stop.

Any help would be much appreciated as I am not a programmer. Thank you

Button_TEST.ino (20.7 KB)

I'm an Arduino noob too, but it looks to me like you are using 20 delays in one of your animations, totaling 1 second. Nothing else can happen while this processes. Was that your intention?

If I was trying to animate, I think I would make a var like 'frameNoRingsOut', and increment it every 50ms, without using any delay() instructions. Then use that var to draw the appropriate graphics using a bit of maths to work out the co-ordinates, rather than using 20 sets of u8g2 functions.

Many thanks but I have it sorted now took a while but got their in the end with Push Button Counter.

Thanks again