|
| 1 | +--- |
| 2 | +id: setup |
| 3 | +title: Install & Set Up MicroPython |
| 4 | +sidebar_label: Setup |
| 5 | +sidebar_position: 1 |
| 6 | +description: Step-by-step guide to flash MicroPython on a Raspberry Pi Pico W with the Pimoroni Explorer extension board, using the official Raspberry Pi Pico extension for VS Code. |
| 7 | +--- |
| 8 | + |
| 9 | +## Prerequisites |
| 10 | + |
| 11 | +* **Hardware** |
| 12 | + |
| 13 | + * Raspberry Pi **Pico W** (RP2040 + Wi-Fi) |
| 14 | + * **Pimoroni Explorer Pico W** extension board |
| 15 | + (provides motors, analog sensors, capacitive touch, LEDs, and more) |
| 16 | + * USB data cable (USB-A/USB-C to micro-USB) |
| 17 | +* **Software** |
| 18 | + |
| 19 | + * [Visual Studio Code](https://code.visualstudio.com/) installed |
| 20 | + * **Raspberry Pi Pico** extension for VS Code |
| 21 | + |
| 22 | +:::tip Why use the extension? |
| 23 | +The official Raspberry Pi Pico extension streamlines: |
| 24 | + |
| 25 | +* Creating a MicroPython project |
| 26 | +* Opening a REPL |
| 27 | +* Uploading files to the Pico W |
| 28 | +::: |
| 29 | +:::note |
| 30 | +Alternatively, you can use [Wyliodrin Studio](https://ecothings.wyliodrin.studio/). |
| 31 | +::: |
| 32 | + |
| 33 | +--- |
| 34 | + |
| 35 | +## 1) Install the Raspberry Pi Pico extension |
| 36 | + |
| 37 | +1. Open **VS Code**. |
| 38 | +2. Go to **Extensions** (left sidebar) -> search for **"Raspberry Pi Pico"**. |
| 39 | +3. Install the extension published by **Raspberry Pi**. |
| 40 | + |
| 41 | +--- |
| 42 | + |
| 43 | +## 2) How to open the VS Code Command Palette |
| 44 | + |
| 45 | +The **Command Palette** is where you access all extension commands. |
| 46 | + |
| 47 | +* **Windows / Linux:** Press `Ctrl + Shift + P` |
| 48 | +* **macOS:** Press `Cmd + Shift + P` |
| 49 | + |
| 50 | +You can also open it from the menu: |
| 51 | +**View -> Command Palette...** |
| 52 | + |
| 53 | +--- |
| 54 | + |
| 55 | +## 3) Create a MicroPython project (via the extension) |
| 56 | + |
| 57 | +1. Open the **Command Palette** (`Ctrl/Cmd + Shift + P`). |
| 58 | +2. Search for and select: **`Pico: New Project (MicroPython)`**. |
| 59 | +3. Choose a folder for your project. |
| 60 | +4. When asked for **Board**, pick **Raspberry Pi Pico W**. |
| 61 | + |
| 62 | +--- |
| 63 | + |
| 64 | +## 4) Flash the MicroPython firmware |
| 65 | + |
| 66 | +If firmware was already flashed, skip to step 5. |
| 67 | + |
| 68 | +1. **Unplug** the Pico W from USB. |
| 69 | +2. **Hold down** the **BOOTSEL** button on the Pico. |
| 70 | +3. While holding, **connect** the USB cable to your computer. |
| 71 | +4. Release the button when a USB mass-storage drive (e.g., `RPI-RP2`) appears. |
| 72 | +5. Download the latest release for pimoroni **picow** micropython from the [releases](https://github.com/pimoroni/pimoroni-pico/releases) page. |
| 73 | +6. Copy the `.uf2` file to the `RPI-RP2` drive. |
| 74 | + |
| 75 | +--- |
| 76 | + |
| 77 | +## 5) Common VS Code commands for Pico W |
| 78 | + |
| 79 | +Open the **Command Palette** and look for: |
| 80 | + |
| 81 | +* **`Pico: New Project (MicroPython)`** |
| 82 | +* **`Pico: Flash MicroPython (UF2)`** |
| 83 | +* **`Pico: Open REPL`** |
| 84 | +* **`Pico: Upload Project to Pico`** |
| 85 | + |
| 86 | +--- |
| 87 | + |
| 88 | +## 6) Troubleshooting |
| 89 | + |
| 90 | +### The `RPI-RP2` drive doesn't appear (BOOTSEL) |
| 91 | + |
| 92 | +* Try a **different USB cable** (some are charge-only). |
| 93 | +* Hold **BOOTSEL**, plug in, then release **after** connecting. |
| 94 | +* Use a direct USB port (avoid hubs). |
| 95 | + |
| 96 | +### REPL/serial port not found |
| 97 | + |
| 98 | +* **Windows**: Check **Device Manager -> Ports (COM & LPT)**. |
| 99 | +* **macOS**: Look for `/dev/tty.usbmodem*`. |
| 100 | +* **Linux**: Look for `/dev/ttyACM*`. You may need to add your user to the `dialout` group and re-login: |
| 101 | + |
| 102 | + ```bash |
| 103 | + sudo usermod -a -G dialout $USER |
| 104 | + ``` |
| 105 | + |
| 106 | + If still blocked, confirm your **udev** rules allow access to `ttyACM`. |
| 107 | + |
| 108 | +### Upload succeeds but nothing runs |
| 109 | + |
| 110 | +* Open the **REPL** to see exceptions printed at startup. |
| 111 | + |
| 112 | +## 7) Useful links |
| 113 | + |
| 114 | +* [rp2 micropython documentation](https://docs.micropython.org/en/latest/rp2/quickref.html) |
| 115 | +* [Pimoroni examples and libraries](https://github.com/pimoroni/pimoroni-pico) |
| 116 | + |
| 117 | +--- |
0 commit comments