romu-usb-cdc-logging.py

Bitmerse Romu Compact USB Development Board (RP2354A) · File : romu-usb-cdc-logging.py · Language : Python (MicroPython) · Use case : Mettre en place une console de débogage série USB (CDC) pour surveiller l'état des boutons et de la LED.

Simple MicroPython script to interact with internal components via the USB serial port.

Flash MicroPython onto the Romu card. Open a serial terminal (e.g., Thonny, PuTTY) on the USB port. This script uses internal GPIOs. Ideal for rapid prototyping without compiling 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)

← Back to the board