romu-usb-cdc-logging.py
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)