# Using the CircuitPython Extension for Visual Studio Code

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/134/083/medium800/microcontrollers_banner.jpg?1733846984)

One of the great features of CircuitPython is that you can edit your code with a simple text editor - no integrated development environment (IDE) required! But what if you _do_ want to use an IDE? You can use the [CircuitPython v2 extension](https://github.com/wmerkens/vscode-circuitpython) for VS Code for a fully featured CircuitPython development experience - including the REPL.

The CircuitPython v2 extension is easily installed from the extensions tab in VS Code. After installation, you can open your **CIRCUITPY** drive with VS Code and access your connected CircuitPython board over the serial monitor or REPL.

![microcontrollers_2024-12-10_11-17-13_1.gif](https://cdn-learn.adafruit.com/assets/assets/000/134/085/medium640thumb/microcontrollers_2024-12-10_11-17-13_1.jpg?1733848615)

## Install VS Code

Before following this guide, you'll need to&nbsp;[install VS Code](https://code.visualstudio.com/download) on your computer. [Microsoft has extensive documentation](https://code.visualstudio.com/docs) detailing the installation process and features available in VS Code.

Info: You'll need to install VS Code before installing the CircuitPython v2 extension.

# Using the CircuitPython Extension for Visual Studio Code

## Microsoft VS Code Docs

# Using the CircuitPython Extension for Visual Studio Code

## Install the CircuitPython Extension for VS Code

![](https://cdn-learn.adafruit.com/assets/assets/000/133/951/medium800/microcontrollers_Screenshot_2024-12-03_144955.png?1733430550)

Click on the **Extensions tab** in VS Code. Search for **CircuitPython**. Click **Install** for **CircuitPython v2 by wmerkens**.

![microcontrollers_Screenshot_2024-12-03_144940.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/950/medium640/microcontrollers_Screenshot_2024-12-03_144940.jpg?1733430456)

Confirm the installation by clicking **Trust Workspace & Install**.

![microcontrollers_Screenshot_2024-12-03_145007.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/952/medium640/microcontrollers_Screenshot_2024-12-03_145007.jpg?1733430593)

You can confirm the installation by going to your **Extensions tab** and searching under the **Installed column**.

![](https://cdn-learn.adafruit.com/assets/assets/000/133/953/medium800/microcontrollers_Screenshot_2024-12-05_153120.png?1733430729)

# Using the CircuitPython Extension for Visual Studio Code

## Use the CircuitPython Extension for VS Code

Connect your CircuitPython board to your computer with a known good data USB cable. Next, you'll connect to the board using the CircuitPython extension.

Featured
### Pink and Purple Woven USB A to USB C Cable - 1 meter long

[Pink and Purple Woven USB A to USB C Cable - 1 meter long](https://www.adafruit.com/product/5153)
This cable is not only super-fashionable, with a woven pink and purple Blinka-like pattern, it's also made for USB C for our modernized breakout boards, Feathers, and more.&nbsp;&nbsp;[If you want something just like it but for Micro B, we...](https://www.adafruit.com/product/4111)

Out of Stock
[Buy Now](https://www.adafruit.com/product/5153)
[Related Guides to the Product](https://learn.adafruit.com/products/5153/guides)
![Angled shot of coiled pink and purple USB cable with USB A and USB C connectors.](https://cdn-shop.adafruit.com/640x480/5153-02.jpg)

In the **Explorer** tab in VS Code, select **Open Folder...**

![microcontrollers_Screenshot_2024-12-05_150857.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/954/medium640/microcontrollers_Screenshot_2024-12-05_150857.jpg?1733431018)

Select your **CIRCUITPY** drive and click **Select Folder**.

![microcontrollers_Screenshot_2024-12-05_151019.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/955/medium640/microcontrollers_Screenshot_2024-12-05_151019.jpg?1733431102)

You'll see the contents of your **CIRCUITPY** drive appear in VS Code. The CircuitPython extension activates when any of these files are opened in VS Code:

- **code.py**
- **code.txt**
- **main.py**
- **main.txt**
- **boot\_out.txt**

By opening your **CIRCUITPY** drive, the extension is now activated.

&nbsp;

&nbsp;

![microcontrollers_Screenshot_2024-12-05_151053.png](https://cdn-learn.adafruit.com/assets/assets/000/133/956/medium640/microcontrollers_Screenshot_2024-12-05_151053.png?1733431203)

At the bottom of the VS Code window, you'll see text that says **\<Choose a board\>** and a little&nbsp; **plug icon**. Select the **plug icon**.

![microcontrollers_Screenshot_2024-12-05_151108.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/958/medium640/microcontrollers_Screenshot_2024-12-05_151108.jpg?1733431525)

In the **search bar at the top** of VS Code, you'll see **Select a serial port** appear in the bar. In the dropdown, you should see your **CIRCUITPY drive board name** and its COM port. Click on the board.

![](https://cdn-learn.adafruit.com/assets/assets/000/133/959/medium800/microcontrollers_Screenshot_2024-12-05_151131.jpg?1733431642)

This connects to the Serial Port on your board. At the **bottom of the VS Code window** , you'll see your **board name** appear. If you select the **Circuit Python Serial Monitor in the terminal tab** , you'll see that the board COM port is opened and you can access the REPL by entering **CTRL+C**.

![](https://cdn-learn.adafruit.com/assets/assets/000/133/960/medium800/microcontrollers_Screenshot_2024-12-05_151147.jpg?1733431731)

## Using the Serial Monitor and REPL

Press&nbsp; **CTRL+D** , you should see a soft reboot occur and your **code.py** file should run.

![](https://cdn-learn.adafruit.com/assets/assets/000/133/962/medium800/microcontrollers_Screenshot_2024-12-05_151259.png?1733431989)

In the serial monitor above, this simple **code.py** file is running where the value of `i` increases by `1` every second and prints to the serial monitor.

![microcontrollers_Screenshot_2024-12-05_151242.png](https://cdn-learn.adafruit.com/assets/assets/000/133/963/medium640/microcontrollers_Screenshot_2024-12-05_151242.png?1733432087)

You can also enter the REPL by entering **CTRL+C**. Test this out by entering `print("hello world")`. You should see `hello world` print back.

![microcontrollers_Screenshot_2024-12-05_151322.png](https://cdn-learn.adafruit.com/assets/assets/000/133/964/medium640/microcontrollers_Screenshot_2024-12-05_151322.png?1733432124)

## Accessing Special Commands

The CircuitPython extension has special commands available for accessing the serial monitor and library management with [circup](https://github.com/adafruit/circup), a command line tool to manage and update libraries on a CircuitPython device. You can even access a quick link to your board on [circuitpython.org](https://circuitpython.org/).

### Use circup to easily keep your CircuitPython libraries up to date - Overview

[Use circup to easily keep your CircuitPython libraries up to date](https://learn.adafruit.com/keep-your-circuitpython-libraries-on-devices-up-to-date-with-circup)
[Overview](https://learn.adafruit.com/keep-your-circuitpython-libraries-on-devices-up-to-date-with-circup/overview)
In the **search bar** at the top of VS Code, click in the bar. A dropdown menu will appear. Select **Show and Run Commands**.

![microcontrollers_Screenshot_2024-12-05_151347.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/965/medium640/microcontrollers_Screenshot_2024-12-05_151347.jpg?1733432310)

Search for **CircuitPython** in the commands list. You'll see the available commands for the extension. Like other VS Code commands, you can tie these to keyboard shortcuts if you like.

![microcontrollers_Screenshot_2024-12-05_151425.png](https://cdn-learn.adafruit.com/assets/assets/000/133/966/medium640/microcontrollers_Screenshot_2024-12-05_151425.png?1733432374)

# Using the CircuitPython Extension for Visual Studio Code

## CircuitPython v2 Extension on GitHub


## Guide Products

### Pink and Purple Woven USB A to USB C Cable - 1 meter long

[Pink and Purple Woven USB A to USB C Cable - 1 meter long](https://www.adafruit.com/product/5153)
This cable is not only super-fashionable, with a woven pink and purple Blinka-like pattern, it's also made for USB C for our modernized breakout boards, Feathers, and more.&nbsp;&nbsp;[If you want something just like it but for Micro B, we...](https://www.adafruit.com/product/4111)

Out of Stock
[Buy Now](https://www.adafruit.com/product/5153)
[Related Guides to the Product](https://learn.adafruit.com/products/5153/guides)

## Related Guides

- [CNC Rotary Macropad](https://learn.adafruit.com/cnc-rotary-macropad.md)
- [Remote Shutter Button for MEMENTO](https://learn.adafruit.com/memento-shutter.md)
- [CircuitPython Elgato WiFi Light Controller](https://learn.adafruit.com/circuitpython-elgato-wifi-light-controller.md)
- [CircuitPython MIDI to CV Skull](https://learn.adafruit.com/circuitpython-midi-to-cv-skull.md)
- [BLE Cat Thermal Printer with MEMENTO](https://learn.adafruit.com/ble-cat-thermal-printer-with-memento.md)
- [NeoPixel Sprite Weather Display](https://learn.adafruit.com/neopixel-sprite-weather-display.md)
- [Qualia S3 Compass](https://learn.adafruit.com/qualia-s3-compass.md)
- [PB Gherkin 30% keyboard with KMK, CircuitPython, & KB2040](https://learn.adafruit.com/pb-gherkhin-30-keyboard-with-kmk-circuitpython-kb2040.md)
- [Air Quality Monitor and Case](https://learn.adafruit.com/aqi-case.md)
- [LED Matrix Sports Scoreboard](https://learn.adafruit.com/led-matrix-sports-scoreboard.md)
- [Raspberry Pi Azure IoT Hub Dashboard with CircuitPython](https://learn.adafruit.com/raspberry-pi-iot-dashboard-with-azure-and-circuitpython.md)
- [Moon Flight Tracker](https://learn.adafruit.com/moon-flight-tracker.md)
- [3D Print Ratcatcher 2 Controller Device](https://learn.adafruit.com/3d-print-ratcatcher-2-controller-device-wand.md)
- [Prop-Maker Feather Talking Adabot Clock](https://learn.adafruit.com/prop-maker-feather-talking-adabot-clock.md)
- [Qualia S3 Fireplace](https://learn.adafruit.com/qualia-s3-fireplace.md)
