Тёмный

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

DigiKey
Подписаться 157 тыс.
Просмотров 154 тыс.
50% 1

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: www.digikey.com/en/maker/proj...
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 (datasheets.raspberrypi.org/pi.... Alternatively, if you are on Windows and do not wish to install Build Tools for Visual Studio, you can follow the guide here: shawnhymel.com/2096/how-to-se....
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:
www.digikey.com/en/products/d...
Related Videos:
Intro to MicroPython - Maker.io Tutorial - • Intro to MicroPython -...
Intro to Raspberry Pi Pico and RP2040:
Part 1: VS Code and Blink - • Intro to Raspberry Pi ...
Part 2: Debug with Picoprobe - • Intro to Raspberry Pi ...
Part 3: How to Use PIO - • Intro to Raspberry Pi ...
Related Project Links:
www.digikey.com/en/maker/proj...
Related Articles:
Introduction to MicroPython - www.digikey.com/en/maker/blog...
Raspberry Pi Pico and RP2040 - MicroPython Part 1 - www.digikey.com/en/maker/proj...
Learn more:
Maker.io - www.digikey.com/en/maker
Digi-Key’s Blog - TheCircuit www.digikey.com/en/blog
Connect with Digi-Key on Facebook / digikey.electronics
And follow us on Twitter / digikey

Опубликовано:

 

9 май 2021

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 125   
@rowifi
@rowifi 2 года назад
Jesus... I thought the idea was to make coding easier these days. That setup was crazy,.
@gregorlekse8859
@gregorlekse8859 2 года назад
I think to many steps and to complicated. Needs to be more simple to program for average user
@sdp8483
@sdp8483 28 дней назад
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.
@9A4GEMilan
You skipped too fast to follow all steps how to install SDK and libraries. I am so desperate by now.
@9A4GEMilan
No way to get it working. Plenty of errors. Unable to understand where to install SDK actually. And libraries, it complains constantly it can't find libraries. I do specified exactly folder with all, but no hope.
@tweetyericsson
@tweetyericsson 2 года назад
Python it is then.
@SantaDragon
@SantaDragon 2 года назад
I feel this is nothing for beginners ...
@13mite
@13mite Год назад
RP2040 looks unuseful if I need more time for setting the compiler than to do the software by itself
@tehmudjinkhan2207
@tehmudjinkhan2207 3 года назад
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.
@micahmccloud4408
@micahmccloud4408 2 года назад
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!
@katemoon7476
@katemoon7476 3 года назад
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 RU-vid.
@JG-nm9zk
@JG-nm9zk 3 года назад
already started going ahead setting up picoprobe. thanks for the great intro. I'll probably be returning to the kicad tutorials when I get around to making my project more permanent
@danstorm100
@danstorm100 2 года назад
Your web page and this video provided a working tool chain for the pico. Very usefull.
@zokisavic3063
@zokisavic3063 2 года назад
You're the best. I couldn't find IDE for RP Pico, but with this tool chain and SDK, this is fantastic solution and very simple to setup on Win10.
@wb7ond
@wb7ond 2 года назад
This is cool, I followed the directions except I used cpp and a D: drive, just a couple little hick-ups of my own doing, but easily solved. Great Video, worked like a champ. Had some failed attempts with other tutorials, this just worked... This video is a jewel among all the Python, python, python everywhere I look python..... Thanks Shawn...
@DanMV7400
@DanMV7400 2 года назад
I followed your guide to use MinGW because the normal way I just could not get working! Thank you so much for that excellent guide, now all is working well.
@KeyserTheRedBeard
@KeyserTheRedBeard 2 года назад
incredible video Digi-Key. I smashed the thumbs up on your video. Keep on up the fantastic work.
@Cptnbond
@Cptnbond 3 года назад
Awesome as usual.
@TheSolderingGuy007
@TheSolderingGuy007 Год назад
Detailed yet to the point. Great Job !
@debsarkar4893
Thank you bro amazing tutorial!! With your I got the basic idea and did it as u said and managed to get it working. Afterwards I managed to set it up with Visual Studio 2022 IDE (because I like it more, Personal Preference) using its default cmake project (no visual GDB), had some experience beforehand with those Ninja and CMake things.
Далее
Мой инстаграм: v1.ann
00:13
Просмотров 93 тыс.
Это iPhone 16
00:52
Просмотров 924 тыс.
Programming a Raspberry Pi Pico with C or C++
19:47
Просмотров 107 тыс.
Raspberry Pi Pico
16:16
Просмотров 306 тыс.
Getting Started with the Pico W C/C++ SDK
28:23
Просмотров 23 тыс.
RP2040 - Introduction to Assembly Language - BMA-01
25:21