0

pyportal and the demo program
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

pyportal and the demo program

by diggee17 on Mon May 11, 2020 4:35 pm

My pyportal comes with a demo program which retrieves and displays quotes from Adafruit.com/quotes. I made the required changes to the secret.py file and it ran fine. Now I need to understand why! The Pyportal has some initial file on it but it doesn't have a adafruit-circuitpython-pyportal-XXXX.uf2 file on it. Questions:
1. What exactly is the .uf2 file for? Is it only needed when you are working with MU?
2. Also, I do not understand what code is reading the secret.py file. It isn't referenced in the code.py file. How is the device reading the secret.py file?

I hope I can get some help with these questions. I'm enjoying my CPB and now my Pyportal but I'm trying to understand Circuit Python as well as the devices.

Thanks.

diggee17
 
Posts: 12
Joined: Mon Feb 12, 2018 7:18 pm

Re: pyportal and the demo program

by tannewt on Mon May 11, 2020 5:32 pm

diggee17 wrote:My pyportal comes with a demo program which retrieves and displays quotes from Adafruit.com/quotes. I made the required changes to the secret.py file and it ran fine. Now I need to understand why! The Pyportal has some initial file on it but it doesn't have a adafruit-circuitpython-pyportal-XXXX.uf2 file on it. Questions:
1. What exactly is the .uf2 file for? Is it only needed when you are working with MU?


.uf2 flashes the internal flash with CircuitPython. It doesn't end up in the filesystem because it is written directly to the raw flash.

diggee17 wrote:2. Also, I do not understand what code is reading the secret.py file. It isn't referenced in the code.py file. How is the device reading the secret.py file?


The PyPortal library is reading the secrets.py file for you. So, you are indirectly reading it by including the pyportal library.

diggee17 wrote:I hope I can get some help with these questions. I'm enjoying my CPB and now my Pyportal but I'm trying to understand Circuit Python as well as the devices.

Thanks.


Glad you are enjoying it!

tannewt
 
Posts: 1639
Joined: Thu Oct 06, 2016 8:48 pm

Please be positive and constructive with your questions and comments.