lp-mu-gpio-gpiod.sh

LattePanda Mu Ultra: x86 Compute Module for Embedded AI · File : lp-mu-gpio-gpiod.sh · Language : bash · Use case : Contrôler une LED via GPIO en ligne de commande sous Linux.

Using gpiod tool to drive a GPIO pin as output.

Ensure the GPIO driver is loaded. Identify the correct gpiochip and line number corresponding to your physical pin using 'gpiodetect' and 'gpioinfo'. Run the script with root privileges if needed.

lp-mu-gpio-gpiod.sh

#!/bin/bash
# Script de test GPIO pour LattePanda Mu Ultra sous Linux
# Nécessite le paquet gpiod : sudo apt install gpiod

CHIP="gpiochip0"
LINE="17" # Vérifiez le mapping GPIO spécifique à votre carrier board

echo "Initialisation du GPIO $LINE en sortie..."
gpiod set "$CHIP" "$LINE" 0

echo "Clignotement de la LED (5 fois)..."
for i in {1..5}; do
    gpiod set "$CHIP" "$LINE" 1
    sleep 0.5
    gpiod set "$CHIP" "$LINE" 0
    sleep 0.5
done

echo "Test terminé."

← Back to the board