Intro to Raspberry Pi Pico and RP2040 - C/C++ Part 1: VS Code and Blink | Digi-Key Electronics

preview_player
Показать описание
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.

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:

Related Videos:
Intro to Raspberry Pi Pico and RP2040:

Related Project Links:

Related Articles:

Learn more:
Рекомендации по теме
Комментарии
Автор

Jesus... I thought the idea was to make coding easier these days. That setup was crazy, .

rowifi
Автор

I think to many steps and to complicated. Needs to be more simple to program for average user

gregorlekse
Автор

Wow. That's a lot of configurations you had to go through. Thanks for going through all this hassle so that it is easy for people after you. You really are an expert. PS... your KiCAD videos are some of the best tutorials on all of YouTube.

katemoon
Автор

For anyone getting into this now Raspberry Pi has an official VScode extension that simplifies this. It's in pre-release and made getting to blinky super easy.

sdp
Автор

For a newbie that just bought his pico 5 days ago and have no prior code experience this was a struggle to get through. The failures I encountered were my own fault but I finally got that little green booger to flash!

micahmccloud
Автор

I was just a few hours ago browsing the raspberry pi pico and wondered if I could use it and still program in C, and now I see this video.

tehmudjinkhan
Автор

Apparently the site has changed, because when I go to the "documentation" tab at the bottom of the raspberry pi pico site (as seen 0:45) it no longer leads to the tutorial site but just to some documents.
And if I type in the link directly as shown in the video, it just redirects to raspberry pi's documentation search site.
Any information about where I can find the same info/site as shown in the video here?

Gin-toki
Автор

RP2040 looks unuseful if I need more time for setting the compiler than to do the software by itself

mite
Автор

hi guys...I follow exactly the instructions. But I make have this problem from the git bash terminal in vscode. Anyone can help me to resolve this problem?

$ make
'C:/Program' is not recognized as an internal or external command,
operable program or batch file.
mingw32-make: *** [Makefile:90: all] Error 1

amirabdjamalnuvending
Автор

The configuration process reminded me of the uncountable frustrating hours trying to get into embedded coding with c++. I have left make files and manual compilation stuff behind me. Hope the Arduino Core gets more feature-complete in the next month.
I think processor and manufacturer proprietary SDKs are terrible. you are forced to use a supported IDE and there are little documentation and examples online. It's just not productive.

savejeff
Автор

wow. That's so ridiculously complex I can't see many hobbyist doing all that.

hoppynaki
Автор

hi, thank you verry much for this video.
I work on Linux and I have a certain pb at the end of the part, when i copy and paste the .uf2 programm, it works, the led swtchs state between on and off but my pico disappeared from my usb. I mean i don't know where it is, i can not find it and when i use lsusb it is not detected...
Someone can help me pls?

own
Автор

How did you get bash to inherit all the Windows paths and variables in VSCode?

bitdecay
Автор

Lol this video is like telling someone it's easier to remove their teeth with a sledgehammer than dental tools.

mezmerizer
Автор

If you want this on windows, the documentation links to a github project that automates all of this. I'm trying it out now, but see section 9.2. Building on MS Windows

danieldc
Автор

Thanks for the video!!! I have a question that I still can't solve, how can I set in visual code a different RP2040 based board, such as the adafruit feather. Thank you very much.

sebastianabrilvera
Автор

I feel this is nothing for beginners ...

SantaDragon
Автор

Even the pico documentation is out of date for the windows toolchain. Geez, I'll just go back to my attiny2313 on assembly, that was way easier to set up!

larrybud
Автор

Glad the board was only $5, without a raspberry pi 4 and using pc based Linux this was a huge waste of time. I understand why there are so few YouTube videos of folks using this for anything but loading your "examples". I would have thought Digi-Key would understand the need for a simple/classic lib support and setup. KISS always wins in the end.

jessefisher
Автор

Great video! I have started to get so frustrated of setting upp the build environment for the PI PICO. How hard can it be I tell myself and fail for the n:th time. So thank you for the input. I will take your advice and try again this evening...

PATRIKKALLBACK