# Programming Raspberry Pi Pico W

### How to factory reset Raspberry Pi Pico W (not needed for Arduino)

Download the ***flash\_nuke.uf2*** file to your computer from this link <https://datasheets.raspberrypi.com/soft/flash_nuke.uf2>.

Press the BOOTSEL button on Pico and while keeping it pressed, connect it to your computer via a USB cable. The Pico should now appear as a mass storage device on your computer with the label RPI-RP2. Copy and paste the flash\_nuke.uf2 file into this new drive. Your Pico/Pico W will now restart and all the files in its Flash memory will be erased.

### Setting Up the XRP Bot Firmware for MicroPython

1. **Download MicroPython for Raspberry Pi Pico:**

   Go to the MicroPython download page for Raspberry Pi Pico: [MicroPython for Pico](https://micropython.org/download/rp2-pico/) and download the latest version UF2 file.
2. **Load MicroPython onto Pico:**
   * Press and hold the BOOTSEL button on the Pico.
   * Connect the Pico to your computer using a USB cable.
   * Release the BOOTSEL button; the Pico should appear as a drive named `RPI-RP2`.
   * Drag and drop the MicroPython UF2 file ( [XRP Bot MicroPython](https://github.com/Open-STEM/XRPCode/tree/main/micropython)) onto the `RPI-RP2` drive. The Pico will reboot with MicroPython.

### Setting Up the XRP Robot for WPILib Usage

1. **Install WPILib:**
   * Download and install WPILib from the [WPILib Installation Guide](https://docs.wpilib.org/en/stable/docs/zero-to-robot/introduction.html).
   * Follow the platform-specific instructions for Windows, macOS, or Linux.
2. &#x20;Download the firmware
   * Download the firmware from <https://github.com/wpilibsuite/xrp-wpilib-firmware/releases/tag/v1.1.0> and use the same method as before to load it onto the Pico


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hirurobotics.gitbook.io/xrp/experiential-robotics-platform-xrp/programming-raspberry-pi-pico-w.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
