clignotante.py
The first MicroPython program: the LED blinks once per second with serial console tracing. It shows Pin as output, value() and time.sleep, the basis of every embedded script on the board.
Hardware
A generic RP2350 (dual Cortex-M33) board programmed with MicroPython. No external part (external LED + 330 Ω resistor only if the user LED is unavailable).
Wiring
Nothing to wire: the user LED sits on GP25. For an external LED: any GP pin through a 330 Ω resistor to GND.
How it works
Pin(LED_PIN, Pin.OUT) sets the pin as output. The infinite loop alternates value(1)/value(0) with a one-second pause; print() goes to the USB serial (Thonny).
Running it
Flash the « RP2350 » MicroPython build via BOOTSEL (.uf2), then copy the script to the drive. The user LED pin varies by manufacturer: check the board documentation.
Variants
Save as main.py for auto-start, or replace sleep(1) with sleep_ms(100) for fast blinking.
clignotante.py
# Clignotement d'une LED avec MicroPython (module machine.Pin).
# LED utilisateur integree (GP25 sur la majorite des cartes)
from machine import Pin
import time
LED_PIN = 25
led = Pin(LED_PIN, Pin.OUT) # broche en sortie numerique
print("Clignotement demarre sur GP" + str(LED_PIN))
compteur = 0
while True:
led.value(1) # LED allumee
compteur += 1
print("LED ON (cycle %d)" % compteur)
time.sleep(1) # 1 seconde
led.value(0) # LED eteinte
print("LED OFF")
time.sleep(1)
# Pour arreter : bouton Stop dans Thonny (le script tourne aussi
# tout seul s'il est enregistre sous main.py sur la carte).