Quantcast
Viewing all articles
Browse latest Browse all 4909

Beginners • Re: How to run second program with reset

its the RB2040-Touch-LCD-1.28 pico and ... 1.24.0.uf2

Thanks. So it looks like this is the one you are working with https://www.waveshare.com/rp2040-touch-lcd-1.28.htm

The firmware looks like it is for Micro Python.

So as to your question
I would like one to start on boot and when i want the second program to open, i just click restart, when i click restart again it will then go back to the original, etc, etc. How do i do something like this? Would i need to name one boot.py and the other main.py?
First, I would check one script could not support both.

If I was doing this, I would keep BOOT.PY the same. This is the best place to put functions such as connecting to the WIFI.

Two approaches
  • Make a P1 and P2 and have each copy the other to MAIN
  • I can't try this, but load P1 or P2 and call the same function in each. Sorry, I can't try this.

Code:

While True:If  pgm == '1':import p1.pyelse:import p2.pyrtn=mainlinefunction()
WORKED!! Thanks SOOOO much!

Statistics: Posted by sankyships — Fri Dec 06, 2024 11:47 pm



Viewing all articles
Browse latest Browse all 4909

Trending Articles