🛠 Faire clignoter une LED sur les GPIO du CM3

Raspberry Pi Compute Module 3 (CM3 / CM3L) · debutant · Schéma : module CM3 sur carte CMIO3, une LED avec résistance de 330 Ω branchée entre la broche GPIO17 du connecteur GPIO et la masse (GND).

Objectives

Learn how to control a GPIO output on the CM3 using the gpiozero library (provided with Raspberry Pi OS). The CM3 exposes 48 GPIO lines (GPIO0-45) on the SODIMM connector, divided into two independent power banks: bank0 (GPIO0-27) and bank1 (GPIO28-45). Each bank operates at the voltage of its VREF pin, ranging from 1.8 V to 3.3 V — on the CMIO3, the connector is at 3.3 V.

Hardware

Complete Code

#!/usr/bin/env python3
# blink.py — LED sur GPIO17 (bank0), numérotation BCM identique au Pi 3
from gpiozero import LED
from time import sleep

led = LED(17)   # GPIO17, bank0 ; la tension de sortie = tension VREF de la banque

while True:
    led.on
    sleep(1)
    led.off
    sleep(1)
sudo apt update && sudo apt install python3-gpiozero
python3 blink.py

Expected Verification

The LED blinks at 1 Hz (1 s on, 1 s off). Ctrl-C stops the program. The command gpioread 17 (wiringPi) or gpiodetect / gpioinfo gpiochip0 (libgpiod) confirms that the pin is correctly configured as an output.

Common Errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials