Intro to Raspberry Pi Pico and RP2040 - C/C++ Part 1: VS Code and Blink | Digi-Key Electronics
DigiKey
@digikeyAbout
DigiKey Corporation is an industry leader in the distribution of quality electronic components, including Electromechanical, Interconnect, Optoelectronics, Passives, Power, RF & Wireless, Semiconductors, Sensors, Thermal Products and Test Tools. Whether small quantities for prototype design or large volumes for production, the company is committed to product availability, service and performance. Search, find, buy from a manufacturer authorized distributor. Same-day shipment, next-day delivery on orders entered by 8:00pm Central Time (USA). Access product information, datasheets, application notes, product photos, catalog, industry links can be found at http://www.digikey.com
Video Description
Previously, we covered how to program the Raspberry Pi Pico using MicroPython. In this tutorial, we will show you how to create a simple blink program using C. We will also configure VS Code so that it can build projects with the push of a button. Note that the written version of this tutorial can be found here: https://www.digikey.com/en/maker/projects/raspberry-pi-pico-and-rp2040-cc-part-1-blink-and-vs-code/7102fb8bca95452e9df6150f39ae8422 You will need to install the build tools for the RP2040. I recommend following Chapter 1 (for Linux) or Chapter 9 (for macOS and Windows) of the official Getting Started with Raspberry Pi Pico guide (https://datasheets.raspberrypi.org/pico/getting-started-with-pico.pdf). Alternatively, if you are on Windows and do not wish to install Build Tools for Visual Studio, you can follow the guide here: https://shawnhymel.com/2096/how-to-set-up-raspberry-pi-pico-c-c-toolchain-on-windows-with-vs-code/. In VS Code, you will want to install the CMake and CMake Tools extensions. These tools will provide buttons on your status bar that allow you to build your project by clicking a button. All of your projects will need a unique CMakeLists.txt file, which tells the cmake tool how to generate the build files. CMake is a build system generator and does not actually build the program. The Raspberry Pi Pico SDK uses “make” as the actual build system. We can call cmake and make in the command line to build the project, or we can click on the CMake and Build buttons in VS Code to accomplish the same thing. To upload the compiled program, we put the Pico into bootloader mode by pressing and holding the BOOTSEL button when plugging in the USB cable. This will cause the Pico to enumerate as a USB drive on the computer. Then, copy the compiled .uf2 file to that drive. The Pico will reset and automatically start running the program. Product Links: https://www.digikey.com/en/products/detail/raspberry-pi/SC0915/13624793 Related Videos: Intro to MicroPython – Maker.io Tutorial - https://youtu.be/3vnNCSnX7Ig Intro to Raspberry Pi Pico and RP2040: Part 1: VS Code and Blink - https://youtu.be/B5rQSoOmR5w Part 2: Debug with Picoprobe - https://youtu.be/jnC5LrTx470 Part 3: How to Use PIO - https://youtu.be/JSis2NU65w8 Related Project Links: https://www.digikey.com/en/maker/projects/raspberry-pi-pico-and-rp2040-cc-part-1-blink-and-vs-code/7102fb8bca95452e9df6150f39ae8422 Related Articles: Introduction to MicroPython - https://www.digikey.com/en/maker/blogs/2018/introduction-to-micropython Raspberry Pi Pico and RP2040 - MicroPython Part 1 - https://www.digikey.com/en/maker/projects/raspberry-pi-pico-and-rp2040-micropython-part-1-blink/58b3c31ac93649849b58824caa00529c Learn more: Maker.io - https://www.digikey.com/en/maker Digi-Key’s Blog – TheCircuit https://www.digikey.com/en/blog Connect with Digi-Key on Facebook https://www.facebook.com/digikey.electronics/ And follow us on Twitter https://twitter.com/digikey
Kickstart Your Pico Project
AI-recommended products based on this video

10.1 Inch Touch Portable Monitor IPS Screen 1366x768P 60Hz 400 Brightness 99% sRGB HDMI USB-C Monitors Switch for Xbox PS3/4/5 Laptop Compatible with Raspberry Pi, Mini Touch Screen

ELECROW 8 Inch Portable Monitor, 1280x800 Mini HD Display with Built-in Speakers, USB Powered, Non-Touch LCD Screen for Raspberry Pi, PC, Laptop, Jetson Nano, Game Consoles

7 Inch Portable Monitor Touchscreen HD 1024x600 LED Display Dual HDMI Port Small Monitor for PC Raspberry Pi Laptop Computer Xbox PS4/5 Switch Built-in Speakers

BrosTrend 1800Mbps WiFi 6 Linux WiFi Adapter for PC and Raspberry Pi 2+, Long Range USB WiFi Dongle Linux for Ubuntu, Mint, Debian, Kubuntu, Lubuntu, Zorin, Windows 11/10, Dual Band Wireless Antenna

Microcontroller Board for Pico RP2040, Dual Core ARM Cortex M0+Processor Flexible Microcontroller Module (Transparent White)

Microcontroller Board for Pico RP2040, Dual Core ARM Cortex M0+Processor Flexible Microcontroller Module (Black)

Microcontroller Board for Pico RP2040, Dual Core ARM Cortex M0+Processor Flexible Microcontroller Module (Transparent White)

Microcontroller Board for Pico RP2040, Dual Core ARM Cortex M0+Processor Flexible Microcontroller Module (Black)

Lenovo USB-C to USB-C Cable 2m

iWALK Magnetic Power Bank for iPhone, 10000mAh Qi2 15W Wireless Power Bank, 30W Powerbank Fast Charging with USB-C Cable, Portable Charger with LED Display for iPhone 16/15/14/13, Android, Black Recycled Claim Standard Blended

for iPhone 16/15 Pro Max Charger, 20W Fast Charging USB C Charger Block Wall Power Adapter + 6FT USB-C Cable for iPhone 16 Pro Max Plus 16e, iPhone 15 Pro Max, iPad Pro 12.9/11/13 inch, Air 4/5

Anker Nano USB C Wall Charger,45W Fast Charging Smart Display Charger,with 180°Foldable Plug,Smart Recognition,Built-in Care Mode,for iPhone17/16/15 (Non-Battery,One USB-C Port,No Cable Included) ClimatePartner certified

ENOMIR Wireless Carplay Adapter for iPhone, Android Auto Wireless Adapter Fast Stable Auto-Connect, Mini USB Design Plug & Play Most Car Models & iOS Systems

Logitech M185 Wireless Mouse, 2.4GHz with USB Mini Receiver, 12-Month Battery Life, 1000 DPI Optical Tracking, Ambidextrous, Compatible with PC, Mac, Laptop - Black

Mini USB WiFi Adapter,WiFi 6 Network Card, Dual-Band AX900M Adapter Bluetooth 2.4GHz with 5.4,600Mbps 286Mbps 5G &

1300Mbps Mini USB WiFi Adapter for PC, Skybess Dual Band (5G, 2.4G) Wireless Network Adapter for Desktop Laptop, High Speed WiFi Dongle Stick, Compatible with Windows 11/10/8.1/8/7/XP/Vista, Mac OS X

SanDisk 256GB Ultra microSDXC UHS-I Memory Card with Adapter - Up to 150MB/s, C10, U1, Full HD, A1, MicroSD Card - SDSQUAC-256G-GN6MA














