what type code should be programmed into boot.py and main.py in micropython programming ? Can we keep all the code in a single file boot.py ?
Hi, ideally this is what should go in each file accordingly to Adafruit:
“boot.py – This file is run first on power up/reset and should contain low-level code that sets up the board to finish booting. (…)
main.py – If this file exists it’s run after boot.py and should contain any main script that you want to run when the board is powered up or reset.”
So, I don’t think it is recommended to include your main script on the boot.py file, specially if it contains loops. However, if you don’t need to change any of the default configurations on the boot.py file (they are all commented by default), you should be able to run all your code in main.py.
I hope this is clear.
Regards,
Sara