{"id":134681,"date":"2023-10-12T14:44:03","date_gmt":"2023-10-12T14:44:03","guid":{"rendered":"https:\/\/randomnerdtutorials.com\/?p=134681"},"modified":"2023-10-12T14:44:07","modified_gmt":"2023-10-12T14:44:07","slug":"raspberry-pi-pico-vs-code-micropython","status":"publish","type":"post","link":"https:\/\/randomnerdtutorials.com\/raspberry-pi-pico-vs-code-micropython\/","title":{"rendered":"Programming Raspberry Pi Pico with VS Code and MicroPython"},"content":{"rendered":"\n<p>In this guide, you&#8217;ll learn how to program the Raspberry Pi Pico board with MicroPython using VS Code Editor and the MicroPico extension (previously called Pico-W-Go).<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" width=\"1200\" height=\"675\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/Program-Raspberry-Pi-Pico-VS-Code-Micropython.jpg?resize=1200%2C675&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Programming Raspberry Pi Pico with VS Code and MicroPython\" class=\"wp-image-134701\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/Program-Raspberry-Pi-Pico-VS-Code-Micropython.jpg?w=1280&amp;quality=100&amp;strip=all&amp;ssl=1 1280w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/Program-Raspberry-Pi-Pico-VS-Code-Micropython.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/Program-Raspberry-Pi-Pico-VS-Code-Micropython.jpg?resize=1024%2C576&amp;quality=100&amp;strip=all&amp;ssl=1 1024w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/Program-Raspberry-Pi-Pico-VS-Code-Micropython.jpg?resize=768%2C432&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure><\/div>\n\n\n<p class=\"rntbox rntclgreen\"><strong>New to the Raspberry Pi Pico?<\/strong> <a href=\"https:\/\/randomnerdtutorials.com\/getting-started-raspberry-pi-pico-w\/\" title=\"\">Check out our Raspberry Pi Pico Getting Started Guide<\/a>.<\/p>\n\n\n\n<p>If you like to program using VS Code, great news. There&#8217;s an extension for VS Code that allows you to program your Raspberry Pi Pico board using VS Code editor.<\/p>\n\n\n\n<p>If you&#8217;re not used to programming using VS Code, it might be a little difficult to get started. You may stick to simpler IDEs, like <a href=\"https:\/\/randomnerdtutorials.com\/getting-started-raspberry-pi-pico-w\/#install-thonny-ide\" title=\"\">Thonny IDE<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p>To program the Raspberry Pi Pico with VS Code using MicroPython, you need to check the following steps.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"#install-python\" title=\"\">1) Installing Python<\/a><\/h3>\n\n\n\n<p>You need to have <a href=\"https:\/\/www.python.org\/downloads\/\" target=\"_blank\" rel=\"noreferrer noopener\">Python 3.9 or newer<\/a> installed on your system and in your PATH. You also need to have the pyserial package installed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"#flash-micropython\" title=\"\">2) Flashing MicroPython Firmware<\/a><\/h3>\n\n\n\n<p>You need to install MicroPython firmware on your Raspberry Pi Pico. Follow the next section.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#flash-micropython\" title=\"\">Flashing MicroPython Firmware on the Raspberry Pi Pico<\/a><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">3) Installing VS Code<\/h3>\n\n\n\n<p>You need to install VS Code on your computer. Follow one of the next sections if you need to install VS Code:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#VS-code-windows\" title=\"\">A) Installing VS Code on Windows<\/a><\/li>\n\n\n\n<li><a href=\"#vs-code-mac-os\" title=\"\">B) Installing VS Code on Mac OS X<\/a><\/li>\n\n\n\n<li><a href=\"#vs-code-ubuntu\" title=\"\">C) Installing VS Code on Linux Ubuntu<\/a><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"#micropico-install\" title=\"\">4) Installing MicroPico Extension<\/a><\/h3>\n\n\n\n<p>Finally, follow the instructions to set up the MicroPico extension, configure your project folder and run your first project:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#micropico-install\" title=\"\">Installing MicroPico Extension<\/a><\/li>\n\n\n\n<li><a href=\"#micropython-project-configure\" title=\"\">Configuring a MicroPython Project Folder<\/a><\/li>\n\n\n\n<li><a href=\"#run-micropython-file\" title=\"\">Running a MicroPython File<\/a><\/li>\n\n\n\n<li><a href=\"#upload-micropython-file\" title=\"\">Uploading a MicroPython File<\/a><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"install-python\">Installing Python<\/h2>\n\n\n\n<p><strong>1.<\/strong>&nbsp;Go to the Python Downloads page:&nbsp;<a href=\"https:\/\/www.python.org\/downloads\/\" target=\"_blank\" rel=\"noreferrer noopener\">www.python.org\/downloads<\/a>&nbsp;and download the installation file.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"954\" height=\"562\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/Download-python.png?resize=954%2C562&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Download and install Python\" class=\"wp-image-134689\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/Download-python.png?w=954&amp;quality=100&amp;strip=all&amp;ssl=1 954w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/Download-python.png?resize=300%2C177&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/Download-python.png?resize=768%2C452&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 954px) 100vw, 954px\" \/><\/figure><\/div>\n\n\n<p><strong>2.<\/strong>&nbsp;After a few seconds, you should have an executable file downloaded to your computer. Double-click the file to open it.<\/p>\n\n\n\n<p><strong>3. <\/strong>Make sure you have the option <em>Add Python to PATH <\/em>ticked to add Python to path.<\/p>\n\n\n\n<p><strong>4.<\/strong> Then, you can proceed with the installation. <\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"flash-micropython\">Flashing MicroPython Firmware on the Raspberry Pi Pico<\/h2>\n\n\n\n<p>You can flash MicroPython firmware on your Raspberry Pi Pico by connecting it to a computer via USB, then dragging and dropping a file onto it. Click on one of the following links to download the MicroPython firmware for your board (if you have a W version, you can choose if you want to add support for Bluetooth):<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/micropython.org\/download\/rp2-pico\/rp2-pico-latest.uf2\" target=\"_blank\" rel=\"noopener\" title=\"\">Raspberry Pi Pico<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/micropython.org\/download\/rp2-pico-w\/rp2-pico-w-latest.uf2\" target=\"_blank\" rel=\"noopener\" title=\"\">Raspberry Pi Pico W<\/a>\u00a0with Wi-Fi support<\/li>\n\n\n\n<li><a href=\"https:\/\/datasheets.raspberrypi.com\/soft\/micropython-firmware-pico-w-130623.uf2?_gl=1*358jzd*_ga*MTU0Mjk2MzYyOC4xNjgyOTMyMDYw*_ga_22FD70LWDS*MTY5MjYxNDYwOC40LjAuMTY5MjYxNDYwOC4wLjAuMA..\" target=\"_blank\" rel=\"noopener\" title=\"\">Raspberry Pi Pico W<\/a>\u00a0with Wi-Fi and BLE (Bluetooth Low Energy) support<\/li>\n<\/ul>\n\n\n\n<p>Then follow the next steps:<\/p>\n\n\n\n<p>Connect the board to your computer via the USB cable <strong>while holding the BOOTSEL<\/strong> button at the same time to put it in bootloader mode.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"750\" height=\"422\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/05\/Raspberry-Pi-Pico-Bottloader-mode.jpg?resize=750%2C422&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Raspberry Pi Pico BOOT Mode\" class=\"wp-image-130903\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/05\/Raspberry-Pi-Pico-Bottloader-mode.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/05\/Raspberry-Pi-Pico-Bottloader-mode.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<p>A new Mass Storage Device called RPi-RP2 will show up.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"867\" height=\"372\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/Rpi-USB-Device.png?resize=867%2C372&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Raspberry Pi Pico Storage Device\" class=\"wp-image-134685\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/Rpi-USB-Device.png?w=867&amp;quality=100&amp;strip=all&amp;ssl=1 867w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/Rpi-USB-Device.png?resize=300%2C129&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/Rpi-USB-Device.png?resize=768%2C330&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 867px) 100vw, 867px\" \/><\/figure><\/div>\n\n\n<p>Drag and drop the MicroPython file you downloaded previously onto the RPI-RP2 device. The window will automatically close and your device will be running MicroPython.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"VS-code-windows\">A) Installing VS Code on Windows<\/h2>\n\n\n\n<p>Go to <a href=\"https:\/\/code.visualstudio.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/code.visualstudio.com\/<\/a> and download the stable build for your operating system (Windows).<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1012\" height=\"682\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/1-Download-VS-Studio-Code.jpg?resize=1012%2C682&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Microsoft Visual Studio Code VS Code Download Page for Windows PC\" class=\"wp-image-99205\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/1-Download-VS-Studio-Code.jpg?w=1012&amp;quality=100&amp;strip=all&amp;ssl=1 1012w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/1-Download-VS-Studio-Code.jpg?resize=300%2C202&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/1-Download-VS-Studio-Code.jpg?resize=768%2C518&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 1012px) 100vw, 1012px\" \/><\/figure><\/div>\n\n\n<p>Click on the installation wizard to start the installation and follow all the steps to complete the installation. Accept the agreement and press the <strong>Next <\/strong>button.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"598\" height=\"464\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/2-Install-VS-Code.png?resize=598%2C464&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Microsoft Visual Studio Code VS Code Installation wizard\" class=\"wp-image-99206\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/2-Install-VS-Code.png?w=598&amp;quality=100&amp;strip=all&amp;ssl=1 598w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/2-Install-VS-Code.png?resize=300%2C233&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 598px) 100vw, 598px\" \/><\/figure><\/div>\n\n\n<p>Select the following options and click <strong>Next<\/strong>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"598\" height=\"464\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/3-Install-VS-Code.png?resize=598%2C464&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Microsoft Visual Studio Code VS Code Installation wizard step 2\" class=\"wp-image-99207\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/3-Install-VS-Code.png?w=598&amp;quality=100&amp;strip=all&amp;ssl=1 598w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/3-Install-VS-Code.png?resize=300%2C233&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 598px) 100vw, 598px\" \/><\/figure><\/div>\n\n\n<p>Press the <strong>Install <\/strong>button.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"598\" height=\"464\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/4-Install-VS-Code.png?resize=598%2C464&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Microsoft Visual Studio Code VS Code Installation wizard step 3\" class=\"wp-image-99208\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/4-Install-VS-Code.png?w=598&amp;quality=100&amp;strip=all&amp;ssl=1 598w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/4-Install-VS-Code.png?resize=300%2C233&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 598px) 100vw, 598px\" \/><\/figure><\/div>\n\n\n<p>Finally, click <strong>Finish <\/strong>to finish the installation.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"598\" height=\"464\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/5-Install-VS-Code.png?resize=598%2C464&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Microsoft Visual Studio Code VS Code Installation wizard final step\" class=\"wp-image-99204\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/5-Install-VS-Code.png?w=598&amp;quality=100&amp;strip=all&amp;ssl=1 598w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/5-Install-VS-Code.png?resize=300%2C233&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 598px) 100vw, 598px\" \/><\/figure><\/div>\n\n\n<p>Open VS Code and you\u2019ll be greeted by a Welcome tab with the released notes of the newest version.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1033\" height=\"770\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/VS-Code-Welcome-Screen.png?resize=1033%2C770&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Microsoft Visual Studio Code VS Code Installation wizard welcome screen on a Windows PC\" class=\"wp-image-99216\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/VS-Code-Welcome-Screen.png?w=1033&amp;quality=100&amp;strip=all&amp;ssl=1 1033w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/VS-Code-Welcome-Screen.png?resize=300%2C224&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/VS-Code-Welcome-Screen.png?resize=1024%2C763&amp;quality=100&amp;strip=all&amp;ssl=1 1024w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/VS-Code-Welcome-Screen.png?resize=768%2C572&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 1033px) 100vw, 1033px\" \/><\/figure><\/div>\n\n\n<p>That\u2019s it. Visual Studio Code was successfully installed.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"vs-code-mac-os\">B) Installing VS Code on Mac OS X<\/h2>\n\n\n\n<p>Go to <a href=\"https:\/\/code.visualstudio.com\/\" target=\"_blank\" rel=\"noopener\" title=\"\">https:\/\/code.visualstudio.com\/<\/a> and download the stable build for your operating system (Mac OS X).<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1167\" height=\"592\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/3-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-download-Mac-OS-X.png?resize=1167%2C592&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Microsoft Visual Studio Code VS Code Download Page for Mac OS X\" class=\"wp-image-99336\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/3-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-download-Mac-OS-X.png?w=1167&amp;quality=100&amp;strip=all&amp;ssl=1 1167w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/3-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-download-Mac-OS-X.png?resize=300%2C152&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/3-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-download-Mac-OS-X.png?resize=1024%2C519&amp;quality=100&amp;strip=all&amp;ssl=1 1024w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/3-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-download-Mac-OS-X.png?resize=768%2C390&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 1167px) 100vw, 1167px\" \/><\/figure><\/div>\n\n\n<p>After downloading the Visual Studio Code application file, you&#8217;ll be prompted with the following message. Press the &#8220;<strong>Open<\/strong>&#8221; button.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"487\" height=\"158\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/5-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-save-file.png?resize=487%2C158&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Microsoft Visual Studio Code VS Code Downloading application file for Mac OS X\" class=\"wp-image-99338\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/5-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-save-file.png?w=487&amp;quality=100&amp;strip=all&amp;ssl=1 487w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/5-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-save-file.png?resize=300%2C97&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 487px) 100vw, 487px\" \/><\/figure><\/div>\n\n\n<p>Or open your Downloads folder and open Visual Studio Code.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"214\" height=\"140\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/4-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-file-downloaded-Mac-OS-X.png?resize=214%2C140&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Microsoft Visual Studio Code VS Code Downloading application file for Mac OS X\" class=\"wp-image-99337\"\/><\/figure><\/div>\n\n\n<p>After that, you\u2019ll be greeted by a Welcome tab with the released notes of the newest version.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"767\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/6-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-installed.png?resize=1024%2C767&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Microsoft Visual Studio Code VS Code Installation wizard welcome screen on Max OS X\" class=\"wp-image-99339\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/6-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-installed.png?w=1024&amp;quality=100&amp;strip=all&amp;ssl=1 1024w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/6-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-installed.png?resize=300%2C225&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/6-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-installed.png?resize=768%2C575&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>That\u2019s it. Visual Studio Code was successfully installed.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"vs-code-ubuntu\">C) Installing VS Code on Linux Ubuntu<\/h2>\n\n\n\n<p>Go to <a href=\"https:\/\/code.visualstudio.com\/\" target=\"_blank\" rel=\"noopener\" title=\"\">https:\/\/code.visualstudio.com\/<\/a> and download the stable build for your operating system (Linux Ubuntu).<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"961\" height=\"438\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/3-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-downloading-VS-Code-Linux-Ubuntu.png?resize=961%2C438&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Microsoft Visual Studio Code VS Code Download Page for Linux Ubuntu\" class=\"wp-image-99324\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/3-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-downloading-VS-Code-Linux-Ubuntu.png?w=961&amp;quality=100&amp;strip=all&amp;ssl=1 961w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/3-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-downloading-VS-Code-Linux-Ubuntu.png?resize=300%2C137&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/3-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-downloading-VS-Code-Linux-Ubuntu.png?resize=768%2C350&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 961px) 100vw, 961px\" \/><\/figure><\/div>\n\n\n<p>Save the installation file:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"495\" height=\"350\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/4-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-downloading-VS-Code-Linux-Ubuntu.png?resize=495%2C350&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Microsoft Visual Studio Code VS Code Save installation file for Linux Ubuntu\" class=\"wp-image-99325\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/4-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-downloading-VS-Code-Linux-Ubuntu.png?w=495&amp;quality=100&amp;strip=all&amp;ssl=1 495w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/4-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-downloading-VS-Code-Linux-Ubuntu.png?resize=300%2C212&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 495px) 100vw, 495px\" \/><\/figure><\/div>\n\n\n<p>To install it, open a Terminal windows, navigate to your Downloads folder and run the following command to install VS Code.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ cd Downloads\n~\/Downloads $ sudo apt install .\/code_1.49.1-1600299189_amd64.deb<\/code><\/pre>\n\n\n\n<p>When the installation is finished, VS Code should be available in your applications menu.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"516\" height=\"326\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/5-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-run-VS-Code-Linux-Ubuntu.png?resize=516%2C326&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Microsoft Visual Studio Code VS Code Open application Linux Ubuntu\" class=\"wp-image-99326\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/5-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-run-VS-Code-Linux-Ubuntu.png?w=516&amp;quality=100&amp;strip=all&amp;ssl=1 516w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/5-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-run-VS-Code-Linux-Ubuntu.png?resize=300%2C190&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 516px) 100vw, 516px\" \/><\/figure><\/div>\n\n\n<p>Open VS Code and you\u2019ll be greeted by a Welcome tab with the released notes of the newest version.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"632\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/6-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-downloading-VS-Code-Linux-Ubuntu-Testing.png?resize=1024%2C632&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Microsoft Visual Studio Code VS Code Installation wizard welcome screen on Linux Ubuntu\" class=\"wp-image-99327\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/6-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-downloading-VS-Code-Linux-Ubuntu-Testing.png?w=1024&amp;quality=100&amp;strip=all&amp;ssl=1 1024w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/6-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-downloading-VS-Code-Linux-Ubuntu-Testing.png?resize=300%2C185&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/09\/6-Getting-Started-VS-Code-PlatformIO-IDE-ESP32-ESP8266-downloading-VS-Code-Linux-Ubuntu-Testing.png?resize=768%2C474&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>That\u2019s it. Visual Studio Code was successfully installed.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"micropico-install\">Installing MicroPico Extension<\/h2>\n\n\n\n<p>Open VS Code and click on the <strong>Extensions <\/strong>tab at the left sidebar.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"47\" height=\"49\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2021\/04\/VS-Code-Extensions.png?resize=47%2C49&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Installing MicroPico Extension\" class=\"wp-image-103090\"\/><\/figure><\/div>\n\n\n<p>Search for &#8220;MicroPico&#8221; or &#8220;pico-w-go&#8221; and install the <strong>MicroPico <\/strong>Extension.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"863\" height=\"599\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/install-extension-rpi-pico.png?resize=863%2C599&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"installing micropico extension VS Code\" class=\"wp-image-134684\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/install-extension-rpi-pico.png?w=863&amp;quality=100&amp;strip=all&amp;ssl=1 863w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/install-extension-rpi-pico.png?resize=300%2C208&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/install-extension-rpi-pico.png?resize=768%2C533&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 863px) 100vw, 863px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"micropython-project-configure\">Configuring a MicroPython Project Folder<\/h2>\n\n\n\n<p>Now, create a project folder on your computer called for example <em>Pi Pico Test<\/em>. <\/p>\n\n\n\n<p>Then, in VS Code, go to <strong>File <\/strong>&gt; <strong>Open Folder<\/strong> and open the folder you just created.<\/p>\n\n\n\n<p>Press <strong>CTRL<\/strong>+<strong>Shift <\/strong>+<strong>P<\/strong>. A little window will show up to search commands. Write &#8220;micropico&#8221; and then, select the option <strong>MicroPico: Configure project<\/strong>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"749\" height=\"527\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/micropico-configure-project.png?resize=749%2C527&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Configure MicroPython Project Folder Raspberry Pi Pico VS Code\" class=\"wp-image-134691\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/micropico-configure-project.png?w=749&amp;quality=100&amp;strip=all&amp;ssl=1 749w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/micropico-configure-project.png?resize=300%2C211&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 749px) 100vw, 749px\" \/><\/figure><\/div>\n\n\n<p>At the bottom right corner, you should get a success message.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"566\" height=\"113\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/project-configuration-complete-message.png?resize=566%2C113&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"VS Code MicroPython Raspberry Pi Project Configuration Complete\" class=\"wp-image-134692\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/project-configuration-complete-message.png?w=566&amp;quality=100&amp;strip=all&amp;ssl=1 566w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/project-configuration-complete-message.png?resize=300%2C60&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 566px) 100vw, 566px\" \/><\/figure><\/div>\n\n\n<p>Additionally, it should have created some essential files at the left sidebar.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"323\" height=\"339\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/VS-Code-micropython-project-setup.png?resize=323%2C339&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Raspberry Pi Pico VS Code Project Configuration\" class=\"wp-image-134693\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/VS-Code-micropython-project-setup.png?w=323&amp;quality=100&amp;strip=all&amp;ssl=1 323w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/VS-Code-micropython-project-setup.png?resize=286%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 286w\" sizes=\"(max-width: 323px) 100vw, 323px\" \/><\/figure><\/div>\n\n\n<p>At the same time, you should see some commands to interact with your Raspberry Pi Pico.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/micropico-extension-vs-code-commands.png?resize=668%2C29&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"VS Code micropico extension Raspberry Pi Pico\" class=\"wp-image-134694\" style=\"width:668px;height:29px\" width=\"668\" height=\"29\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/micropico-extension-vs-code-commands.png?w=668&amp;quality=100&amp;strip=all&amp;ssl=1 668w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/micropico-extension-vs-code-commands.png?resize=300%2C13&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 668px) 100vw, 668px\" \/><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"run-micropython-file\">Running a MicroPython File<\/h3>\n\n\n\n<p>Inside your project folder, create a new Python file, for example <em>blinking.py,<\/em> and copy the following code.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>from machine import Pin\nfrom time import sleep\n\nled = Pin('LED', Pin.OUT)\nprint('Blinking LED Example')\n\nwhile True:\n  led.value(not led.value())\n  sleep(0.5)<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"858\" height=\"651\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/run-program-pico-VS-Code.png?resize=858%2C651&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Creating MicroPython Project Raspberry Pi Pico VS Code\" class=\"wp-image-134695\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/run-program-pico-VS-Code.png?w=858&amp;quality=100&amp;strip=all&amp;ssl=1 858w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/run-program-pico-VS-Code.png?resize=300%2C228&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/run-program-pico-VS-Code.png?resize=768%2C583&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 858px) 100vw, 858px\" \/><\/figure><\/div>\n\n\n<p>Then, click on the little <strong>Run <\/strong>icon at the bottom of the window.<\/p>\n\n\n\n<p>If everything went as expected, the Raspberry Pi Pico onboard LED should be blinking every half second.<\/p>\n\n\n\n<div class=\"wp-block-jetpack-tiled-gallery aligncenter is-style-rectangular\"><div class=\"tiled-gallery__gallery\"><div class=\"tiled-gallery__row\"><div class=\"tiled-gallery__col\" style=\"flex-basis:50.00000%\"><figure class=\"tiled-gallery__item\"><img decoding=\"async\" srcset=\"https:\/\/i2.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/05\/Raspberry-Pi-Pico-Blinking-LED-On.jpg?strip=info&#038;w=600&#038;ssl=1 600w, https:\/\/i2.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/05\/Raspberry-Pi-Pico-Blinking-LED-On.jpg?strip=info&#038;w=750&#038;ssl=1 750w\" alt=\"Raspberry Pi Pico W onboard LED on\" data-height=\"422\" data-id=\"130907\" data-link=\"https:\/\/randomnerdtutorials.com\/getting-started-raspberry-pi-pico-w\/raspberry-pi-pico-blinking-led-on\/#main\" data-url=\"https:\/\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/05\/Raspberry-Pi-Pico-Blinking-LED-On.jpg\" data-width=\"750\" src=\"https:\/\/i2.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/05\/Raspberry-Pi-Pico-Blinking-LED-On.jpg?ssl=1\" data-amp-layout=\"responsive\"\/><\/figure><\/div><div class=\"tiled-gallery__col\" style=\"flex-basis:50.00000%\"><figure class=\"tiled-gallery__item\"><img decoding=\"async\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/05\/Raspberry-Pi-Pico-Blinking-LED-Off.jpg?strip=info&#038;w=600&#038;ssl=1 600w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/05\/Raspberry-Pi-Pico-Blinking-LED-Off.jpg?strip=info&#038;w=750&#038;ssl=1 750w\" alt=\"Raspberry Pi Pico W onboard LED off\" data-height=\"422\" data-id=\"130908\" data-link=\"https:\/\/randomnerdtutorials.com\/getting-started-raspberry-pi-pico-w\/raspberry-pi-pico-blinking-led-off\/#main\" data-url=\"https:\/\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/05\/Raspberry-Pi-Pico-Blinking-LED-Off.jpg\" data-width=\"750\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/05\/Raspberry-Pi-Pico-Blinking-LED-Off.jpg?ssl=1\" data-amp-layout=\"responsive\"\/><\/figure><\/div><\/div><\/div><\/div>\n\n\n\n<p>Additionally, it will open a new Terminal window (REPL) where it will print the message &#8216;Blinking LED Example&#8217;.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"657\" height=\"215\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/blinking-LED-example-REPL.png?resize=657%2C215&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Blinking LED REPL VS Code Raspberry Pi Pico\" class=\"wp-image-134697\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/blinking-LED-example-REPL.png?w=657&amp;quality=100&amp;strip=all&amp;ssl=1 657w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/blinking-LED-example-REPL.png?resize=300%2C98&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 657px) 100vw, 657px\" \/><\/figure><\/div>\n\n\n<p>To stop the execution of the program, click on the <strong>Stop <\/strong>button at the bottom of the window.<\/p>\n\n\n\n<p><strong>Important note<\/strong>: just running the file doesn\u2019t copy it permanently to the board\u2019s filesystem. This means that if you unplug it from your computer and apply power to the board, nothing will happen because it doesn\u2019t have any Python files saved on its filesystem. The <em>Run&nbsp;<\/em>function is useful to test the code, but if you want to upload it permanently to your board, you need to create and save a file to the board filesystem. MicroPython will automatically run a file called <em>main.py <\/em>on boot. See the next section.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"upload-micropython-file\">Uploading a MicroPython File<\/h3>\n\n\n\n<p>Inside your project folder, create another file called <em><strong>main.py<\/strong><\/em> and copy the exact same code.<\/p>\n\n\n\n<pre class=\"wp-block-code language-python\"><code>from machine import Pin\nfrom time import sleep\n\nled = Pin('LED', Pin.OUT)\nprint('Blinking LED Example')\n\nwhile True:\n  led.value(not led.value())\n  sleep(0.5)<\/code><\/pre>\n\n\n\n<p>Then, press <strong>CTRL<\/strong>+<strong>Shift<\/strong>+<strong>P<\/strong>, or click on the <strong>All commands<\/strong> button at the bottom of the window. Write <strong><em>MicroPico <\/em><\/strong>and select the option <strong>MicroPico: Upload current file to Pico.<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"768\" height=\"405\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/upload-current-file-Rpi-Pico-VS-Code.png?resize=768%2C405&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Raspberry Pi Pico MicroPico Upload current File\" class=\"wp-image-134698\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/upload-current-file-Rpi-Pico-VS-Code.png?w=768&amp;quality=100&amp;strip=all&amp;ssl=1 768w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/upload-current-file-Rpi-Pico-VS-Code.png?resize=300%2C158&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/figure><\/div>\n\n\n<p>You should get a success message after a few seconds. Now, you can unplug the board from your computer and power it using a power bank for example. You&#8217;ll see that the board will start blinking the LED as soon as power is applied (for this to happen, the file should be called <em><strong>main.py<\/strong><\/em> and it should be uploaded to the board).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Wrapping Up<\/h2>\n\n\n\n<p>This article was a quick guide to show you how to set up VS Code with the MicroPico extension (previously called Pico-W-Go) to program the Raspberry Pi Pico with MicroPython.<\/p>\n\n\n\n<p>If you\u2019ve never used VS Code, it might be a little difficult to get started. If you find that this option is very advanced, you might consider using simpler IDEs like&nbsp;<a href=\"https:\/\/randomnerdtutorials.com\/getting-started-raspberry-pi-pico-w\/#install-thonny-ide\" title=\"\">Thonny IDE<\/a>.<\/p>\n\n\n\n<p>Alternatively, if you prefer to program the Raspberry Pi Pico using C\/C++ with Arduino IDE, you can follow the next tutorial:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/randomnerdtutorials.com\/programming-raspberry-pi-pico-w-arduino-ide\/\">Programming Raspberry Pi Pico with Arduino IDE (Pico W compatible)<\/a><\/li>\n<\/ul>\n\n\n\n<p>Other MicroPython tutorials to get started:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/randomnerdtutorials.com\/raspberry-pi-pico-w-pinout-gpios\/\">Raspberry Pi Pico and Pico W Pinout Guide: GPIOs Explained<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/raspberry-pi-pico-outputs-inputs-arduino\/\">Raspberry Pi Pico: Control Digital Outputs and Read Digital Inputs (Arduino IDE)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/raspberry-pi-pico-outputs-inputs-micropython\/\">Raspberry Pi Pico: Control Digital Outputs and Read Digital Inputs (MicroPython)<\/a><\/li>\n<\/ul>\n\n\n\n<p>Thanks for reading.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, you&#8217;ll learn how to program the Raspberry Pi Pico board with MicroPython using VS Code Editor and the MicroPico extension (previously called Pico-W-Go). New to the Raspberry &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Programming Raspberry Pi Pico with VS Code and MicroPython\" class=\"read-more button\" href=\"https:\/\/randomnerdtutorials.com\/raspberry-pi-pico-vs-code-micropython\/#more-134681\" aria-label=\"Read more about Programming Raspberry Pi Pico with VS Code and MicroPython\">CONTINUE READING \u00bb<\/a><\/p>\n","protected":false},"author":5,"featured_media":134701,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[324,326],"tags":[],"class_list":["post-134681","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-raspberry-pi-pico","category-raspberry-pi-pico-micropython"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2023\/08\/Program-Raspberry-Pi-Pico-VS-Code-Micropython.jpg?fit=1280%2C720&quality=100&strip=all&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/134681","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/comments?post=134681"}],"version-history":[{"count":16,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/134681\/revisions"}],"predecessor-version":[{"id":137474,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/134681\/revisions\/137474"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media\/134701"}],"wp:attachment":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media?parent=134681"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/categories?post=134681"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/tags?post=134681"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}