yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
Raspberry Pi Pico 2📖
1. About Pico 2
  • Introduction to Raspberry Pi PICO 2
2. Development-python
  • 1. Flash the firmware
  • 2. Software environment configuration
  • 3. Download a program
3. Development-C
  • 1. Software environment configuration
  • 2. Download a program
4. Python course
  • 1. Flash the onboard LED light
  • 2. Onboard temperature sensor reading
  • 3. Button control LED light
  • 4. Buzzer
  • 5. PWM pin
5. C course
  • 1. Flash the onboard LED light
  • 2. Onboard temperature sensor reading
  • 3. Button control LED light
  • 4. Buzzer
  • 5. PWM pin
Download
  • C software
  • Python software
  • Official information
Download ZIP

Welcome to Raspberry Pi Pico 2 repository

2. Download a program

2. Download a program

Try to create a project and download the program.

Project Generator

If you don't want to configure the project manually, you can use the project configuration script to generate the project file.

You can go to this

https://github.com/raspberrypi/pico-project-generator

Use Git or directly package and download the file and unzip it,

image-20240910120150984

Open Windows Terminal in the folder and run:

According to the previous pico-project-generator installation path, enter the folder, and then enter py -3 ./pico_project.py --gui

image-20240910120439595

After starting the tool generator, select the project name, select the file path where the project is stored, select pico2 for Board Type, and select create VSCODE in the lower left corner project, and then click OK.

image-20240910120646688

Click OK again.

image-20240910121008198

After clicking the .C file, copy the code into it and save it

image.png

​x
#include "pico/stdlib.h"
#define LED_PIN 25

int main()
{
gpio_init(LED_PIN);
gpio_set_dir(LED_PIN, GPIO_OUT);

while (1)
{
gpio_put(LED_PIN, 1);
sleep_ms(1000);
gpio_put(LED_PIN, 0);

sleep_ms(1000);
}
}

image.png

After entering the bulid path of the project, delete all files in the folder

Enter the project path through the command line

image-20240910184805641

Enter the following command to compile

xxxxxxxxxx
cmake .. -G "NMake Makefiles"
nmake

image-20240910184951941

After the compilation is complete, files in formats such as .bin .hex .elf .uf2 can be generated in the build directory.

image-20240910185237208

Drag the u2f in the above file into the disk recognized by Pico (Note: When burning for the first time, it is an empty code. Pico 2 can directly recognize the disk when connected to USB. When there is an executable program in it, you need to hold down the BOOTSEL button and then connect USB) After dragging, the disk is disconnected and execution begins (the blink compiled file used here has the onboard LED flashing)

Software environment configuration
Flash the onboard LED light

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文