Example Code for Arduino-Light LED
Last revision 2026/01/18
The article offers a detailed tutorial on making an onboard LED blink using Arduino, covering hardware and software setup, wiring, and sample code to help beginners learn electronics programming.
Hardware Preparation
- DFRobot Beetle RP2040, 1, Purchase Link
- USB Type-C Cable, 1, (Standard USB 2.0 Type-C cable)
Software Preparation
- Arduino IDE: Download Link
- Raspberry Pi Pico/RP2040 SDK: Installed via Arduino Boards Manager (see Getting Started)
Wiring Diagram

Other Preparation Work
- Open Arduino IDE.
- Click the Tools menu and select "DFRobot Beetle RP2040" as the development board (see Getting Started).
- Connect the Beetle RP2040 to your computer using a USB Type-C cable.
Sample Code
Function: make the onboard LED blink at 1 second intervals.
void setup() {
pinMode(LED_BUILTIN, OUTPUT);//set the pin to output mode
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH); //write high level to the port
delay(1000); // delay for one second
digitalWrite(LED_BUILTIN, LOW); //write low level to the port
delay(1000); //delay for one second
}
Result
The onboard LED blinks repeatedly at 1 second intervals.

Additional Information
- The onboard LED is connected to pin 13, consistent with Arduino UNO.
- The Blink routine is a standard example included in the Arduino IDE.
Was this article helpful?
