🛠 Faire clignoter une LED via le MCU Arduino embarqué
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
- LattePanda 3 Delta powered by a compliant source: 11–15 V and at least 24 W (USB-C PD 15 V/3 A or 12 V/3 A recommended, or JST PH2.0 12 V ≥ 2 A connector). A non-PD USB-C adapter or one under 24 W is a documented failure mode.
- 1 LED (Gravity module or standard LED + 220 Ω resistor)
- 3 Dupont cables (female-female for the board's female pin header)
- Operating system: Windows 10/11 or Ubuntu 22.04 (official guide)
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
- Wrong COM port: This is the Leonardo microcontroller's port, not an external USB port. Check in Device Manager or
dmesg | grep ttyon Linux. - Wrong pin number: The 3 Delta's Arduino header exposes 24 digital I/Os (D0–D23); only D13 is used here. Do not confuse it with the two 50-pin blocks which also contain RS232, USB 2.0, etc.
- Insufficient power: A non-PD USB-C phone charger will crash the board before testing even begins.
- Logic level: Official tutorials drive the LED from 5 V; the exact logic level per pin (3.3 V/5 V) is not specified in the consulted specification pages. >
pipinstalls for Python 2: Usepip3/python3on Linux.
Other tutorials for this board
Code examples for this board
clignotante.pyPythonbouton.pyPythonservo.pyPythonanalogique.pyPythonrespiration.pyPythonneopixel.pyPython