install pymakr preview
code --install-extension Pycom.pymakr-preview
ctrl+shift+e
)
select “create project”. Select the same code folder as above and specify a project name (like “hello-world”). Select the option to create a subdirectory with the micropython folder.
Define the name |
create the project in a subfolder |
specify empty project |
Connect your device via usb to your computer
Within the “hello-world” project that is created within the “Pymakr: Projects” tab, add a new device. Follow the prompts to select the appropriate com port
Select your device |
Connect to the device by selecting the lightning bolt icon
Connect to Device |
Open up a terminal window by selecting the box with an arrow in it
Open up a Terminal Window |
A terminal window should open and look like this:
Example of terminal window |
MicroPython v1.19.1 on 2022-06-18; ESP32 module with ESP32
Type "help()" for more information.
>>>
At the command prompt, type in
print('hello world')
which should return
hello world
If you wish to disconnect, you can use:
Figure |
Micropython can either run code from the interpreter (the “terminal” as VSCode puts it), or by loading a file from its onboard storage. When the ESP32 is reset (using the EN button), it looks for two files, in a specific order:
if there are any loops in these files that prevent execution from ending, you must type ctrl+c
to terminate execution from the interpreter window. This will stop any python files from running and bring control back to the interpreter
You must always stop execution on the ESP32 before trying to upload files to it.
Within the “Pymakr: Projects” workspace there are several other buttons that you can use to sync files to the esp32
From the file explorer window, you can also right click and select “pymakr–>upload to device” to upload individual files