romu-usb-cdc-logging.py
Script simple de MicroPython para interactuar con componentes internos a través del puerto serie USB.
Flashee MicroPython en la tarjeta Romu. Abra una terminal serie (ej: Thonny, PuTTY) en el puerto USB. Este script usa GPIOs internos. Ideal para prototipado rápido sin compilar 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)