- Operating system Windows 11
- VS Code development program needs to be installed
- Correct firmware needs to be loaded onto the Raspberry Pi Pico W
-
Enable WSL2 on Windows
-
Set WSL 2 as the default version - Windows console
wsl --set-default-version 2
-
Install Ubuntu distribution - Windows console
wsl --install -d Ubuntu
-
Update dependencies and upgrade the system - WSL console
sudo apt update -y && sudo apt upgrade -y
-
Open the directory I want to mount - WSL console
cd /mnt/c/Users/David/Desktop/RPIPico
-
Attach VSCode to this folder - WSL console
code .
-
Download the latest version of usbipd (currently 2.4.1)
- Link to releases
- Download the .msi file and install it on Windows
-
Install necessary tools for connecting to Windows - WSL console
sudo apt install linux-tools-generic hwdata sudo update-alternatives --install /usr/local/bin/usbip usbip /usr/lib/linux-tools/*-generic/usbip 20
-
Connect the board to USB
-
Display connected devices - Windows console
usbipd wsl list
-
Attach USB device to WSL - Admin windows console
usbipd wsl attach --busid 6-1
-
Display connected devices inside WSL - WSL console
lsusb
-
Find the directory I want to open in VS code, which is connected to WLS - WSL console
code .
-
Python is already installed, but pip needs to be installed - WSL console
sudo apt install python3-pip
-
Install the necessary pyserial package for Python - WSL console
pip install pyserial
-
Install VS code extensions for Raspberry Pi Pico W - VS code
- Pico-W-Go
- Python
- Pylance
- IntelliCode
-
Configure the project - VS code
- CTRL + L SHIFT + P -> Pico-W-Go > Configure project
-
Open a console in the REPL for the board - VS code
- By clicking on the + New Console and selecting the vREPL, open the console for the board.
-
Display the virtual file system of the board to see the files uploaded to it
- Pico-W-Go > Toggle Virtual File System (closes existing vREPLs)
-
Create program
script.py
in my local directory - VS codefrom machine import Pin from time import sleep led = Pin("LED", Pin.OUT) led.on() sleep(1) led.off()
-
Drag and drop the program to the remote directory of the board and run it - VS code
- Pico-W-Go > Remote > Run current file
-
Happy Coding!