🛠 Faire clignoter la LED bleue via le GPIO

ODROID-C4 (Hardkernel) · debutant · Schéma : IMG-odroid-c4-debutant-1-odroidc4-led-gpio.svg — Vue de dessus de l'ODROID-C4 avec la LED bleue status (broche GPIOAO_11) mise en évidence à côté du connecteur 40 broches.

Objectives

Discover the GPIO of the ODROID-C4 under the mainline kernel (Armbian current or DietPi) by blinking the embedded blue "status" LED. You will learn to identify the two exposed GPIO controllers (gpio and gpio_ao), understand the role of the heartbeat kernel trigger, and control a line using libgpiod v2 (Debian Bookworm syntax).

Hardware

Complete code

#!/usr/bin/env bash
# blink-status.sh - clignoter la LED bleue (chip gpio_ao, ligne 11)
# 1) Vérifier la présence des deux chips GPIO

gpiodetect
# 2) Rendre la LED à l'espace utilisateur (désactive le trigger heartbeat)
echo none > /sys/class/leds/blue:status/trigger 2>/dev/null || true
# 3) Boucle de clignotement : 250 ms ON, 250 ms OFF
while true; do
  gpioset --time=250ms gpio_ao 11=1
  gpioset --time=250ms gpio_ao 11=0
done

Expected verification

gpiodetect must list two chips: gpio (GPIOA/GPIOH/GPIOX/BOOT banks) and gpio_ao (always-on bank). After launching the script, the blue LED blinks approximately twice per second. gpioget gpio_ao 11 returns 1 or 0 depending on the moment. Stop with Ctrl+C: the LED remains in its last state.

Common errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials