Ultimate-Starter-Kit-for-Pico-W
  • About This Kit
  • Component List
  • Preparation
  • C Language Tutorial
    • C Language Preparation
    • 1 Output & Input
      • 1.1 LED_Blink (Important)
        • Component List
        • Component knowledge
        • Connect
        • Code
        • Phenomenon
      • 1.2 Button & LED
      • 1.3 Chaser Light
      • 1.4 Analog & PWM
      • 1.5 RGB Light Effects
      • 1.6 Tilt Switch
      • 1.7 Slide_Switch
      • 1.8 Gentle Press
      • 1.9 Magnetic Trigger
      • 1.10 Motion Detection
      • 1.11 Potentiometer Control
      • 1.12 Photoresistor & LED
      • 1.13 Thermometer
      • 1.14 Water Sensor
      • 1.15 NPN Transistor Switch
      • 1.16 Relay Module Control
    • 2 Sound & Display & Movement
    • 3 Controller
    • 4 Microchip
    • 5 Advanced
  • Python Language Tutorial
  • Piper Make Tutorials
  • Components Introduction
Ultimate-Starter-Kit-for-Pico-W
  • C Language Tutorial
  • 1 Output & Input
  • 1.1 LED_Blink (Important)
  • View page source

1.1 LED_Blink (Important)

This chapter is the Start Point in the journey to build and explore Raspberry Pi Pico electronic projects. We will start with simple “Blink” project.

In this project, we will use Pico to control blinking a common LED.

Power Pico needs 5v power supply. In this tutorial, we need connect Pico to computer via USB cable to power it and program it.

Component List

  • Raspberry Pi Pico W x1

  • MicroUSB cable x1

  • 830 Tie-Points Breadboard x1

  • LED x1

  • Resistor 220Ω x1

  • Jumper Wire Several

Component knowledge

LED

Resistor

Breadboard

This circuit works on a simple principle, and the current direction is shown in the figure. The LED will light up after the 220ohm current limiting resistor when GP15 outputs high level (3.3v). The LED will turn off when GP15 outputs low level (0v).

Connect

../_images/1.1.png

Code

Note

  • Open the 1.1_led_blink.ino file under the path of Ultimate-Starter-Kit-for-Pico-W\Arduino\1.Project or copy this code into Thonny, then click “Run Current Script” or simply press F5 to run it.

  • Or copy this code into Arduino IDE.

  • Don’t forget to select the board(Raspberry Pi Pico) and the correct port before clicking the Upload button.

After running the code, you will see the LED light up for 200 milliseconds and then turn off for 200 milliseconds.

If you want to stop the code, you can click the stop button in the IDE or press Ctrl+C in the shell area.

The following is the program code:

/*
  Blink

  Turns an LED on for one second, then off for one second, repeatedly.

  This example uses GPIO 15 for the LED connection on Raspberry Pi Pico.
  Connect the LED with a 220 ohm resistor in series.
*/

// Pin 15 has the LED connected
const int led = 15;

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
}

Phenomenon

Previous Next

© Copyright 2025, BOT.

Built with Sphinx using a theme provided by Read the Docs.