🛠 Faire clignoter une LED via le MCU Arduino embarqué

LattePanda 3 Delta (id: lattepanda-3) · debutant · Schéma : IMG-lattepanda-3-debutant-1-led-mcu.svg — Schéma de câblage : LED sur broche D13 via résistance 220 Ω, alimentation 5 V et GND sur l'en-tête Arduino de la LattePanda 3 Delta.

Objectives

Discover the unique feature of the LattePanda 3 Delta: it is an x86 PC (Intel Celeron N5105) and an Arduino board on the same circuit. The embedded coprocessor is a Microchip ATmega32U4-MU, compatible with the Arduino Leonardo, with its own reset button. In this tutorial, we control an LED from the x86 processor using Python and the official DFRobot pinpong library, which communicates with the microcontroller via the Firmata protocol over its virtual serial port. This is the official Blink tutorial, adapted step by step.

Hardware

Complete Code

Library installation (Windows or Linux):

pip install pinpong

Python program (blink.py) — wiring: LED signal → D13, V+ → 5V, GND → GND:

import time
from pinpong.board import Board, Pin

# Initialisation du ATmega32U4 embarqué (classe Leonardo).
# Windows : COMx affiché dans le Gestionnaire de périphériques ;
# Linux : /dev/ttyACM0
Board("leonardo", "COM5").begin

led = Pin(Pin.D13, Pin.OUT)          # D13 en sortie numérique

while True:
    led.write_digital(1)             # LED allumée
    print("1")
    time.sleep(1)
    led.write_digital(0)             # LED éteinte
    print("0")
    time.sleep(1)

On Linux, replace "COM5" with "/dev/ttyACM0" and run with python3 blink.py.

Expected Verification

The LED blinks for one second on / one second off, and the terminal displays alternating 1 and 0. On Windows, the Leonardo's COM port (device "Arduino Leonardo") must appear in Device Manager; on Linux, ls /dev/ttyACM* must list ttyACM0.

Common Errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials