File Menu |
File –> Open(ctrl+o): If the ESP32 is connected it permits you to open a file either on your computer or from the ESP32’s file space.
Local vs. Remote File System Selection |
File –> Save(ctrl+s): Saves the file to the current destination
File –> Save As(ctrl+shift+s): Permits you to save the file to a new destination, as well as to switch between saving to PC or ESP32
Run Menu |
Shell |
The shell is at the bottom, and permits you to interact directly with the ESP32. Type in a python command and it will run it and (usually) return a value.
For example:
MicroPython v1.18 on 2022-01-17; ESP32 module with ESP32
Type "help()" for more information.
>>> a=1
>>> a
1
>>>
Interrupted Code Execution |
Files in python are called “modules”. To load a module you should use the import
statement. The ESP32, however, also handles specific files as special cases:
while
loop if you want code to continue running.import
that file in either boot.py or main.py if you want it to be loaded and run. For example, if you have a file called “my_program.py”, and want it to be run from “main.py”, open up “main.py” and addimport my_program
This will load and run the my_program.py module at that specific point in the code.
upip
Micropython has the capability to download and use packages from the internet. the upip
module is responsible for this, and you can use it to download and install a number of useful external libraries. For example, assuming you have a working wifi connection established, you can type in the following to the shell
>>> import upip
>>> upip.install('micropython-logging')
This has the effect of downloading the “micropython-logging” package from the pypi python repository to the “/lib/” folder.