🛠 Faire clignoter la LED PC13

GD32F103 (GigaDevice) — chip + Blue-Pill-compatible boards · debutant · Schéma : IMG-gd32f103-debutant-1-clignotement-led.svg — carte GD32F103C8 compatible Blue Pill, LED embarquée PC13 clignotant à 1 Hz

Objectives

Discover the GD32F103C8T6 board compatible with the "Blue Pill" form factor (the GD32F103 from GigaDevice is a near pin-to-pin "drop-in" replacement for the STM32F103, a Cortex-M3 clocked up to 108 MHz) and make the onboard LED blink. By the end of this tutorial, you will know how to install an Arduino core adapted for the GD32, compile, flash, and above all understand why the Blue Pill's LED lights up when writing a LOW level: it is wired in active-LOW on PC13.

Hardware

Complete Code

Arduino IDE with the community core CommunityGD32Cores/ArduinoCore-GD32 (board index URL: https://raw.githubusercontent.com/CommunityGD32Cores/GD32Core-New/main/package_gd32_index.json), board "Generic GD32F103C8".

// blink_pc13.ino — GD32F103C8, core Arduino CommunityGD32Cores
#include <Arduino.h>

void setup {
  pinMode(PC13, OUTPUT);   // LED embarquée, active-LOW sur les cartes Blue Pill
}

void loop {
  digitalWrite(PC13, LOW);   // LED ALLUMÉE (logique inversée !)
  delay(250);
  digitalWrite(PC13, HIGH);  // LED ÉTEINTE
  delay(750);
}

Expected Verification

The LED blinks with a brief flash (250 ms on) followed by a pause (750 ms off), resulting in a cycle of approximately 1 Hz. If you write HIGH and the LED lights up, your board has an active-HIGH LED (rare) or you are not on the correct pin. Also verify that the program is actually running: on these boards, a flash that "succeeds" on the wrong target leaves the LED off.

Common Errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials