romu-usb-cdc-logging.py
Script MicroPython simple pour interagir avec les composants internes via le port USB série.
Flasher MicroPython sur la carte Romu. Ouvrez un terminal série (ex: Thonny, PuTTY) sur le port USB. Ce script utilise les GPIO internes. Idéal pour le prototypage rapide sans compiler du C++.
romu-usb-cdc-logging.py
import machine
import time
# Configuration des broches (À AJUSTER selon schéma Romu)
# Exemple : Bouton sur GPIO 2, LED sur GPIO 25
btn = machine.Pin(2, machine.Pin.IN, machine.Pin.PULL_UP)
led = machine.Pin(25, machine.Pin.OUT)
print("Romu MicroPython Console Ready")
while True:
if btn.value() == 0: # Appui bouton (actif bas)
led.value(1)
print("Button Pressed!")
else:
led.value(0)
time.sleep_ms(50)