Self-contained project code for the "Godot Isn't Just for Games" series: Arduino sketches, the Python serial<->UDP bridge, and the Godot 4 projects, one folder per article.
Part 1 — Your First Arduino Round-Trip
Code for "Godot Isn't Just for Games: Your First Arduino Round-Trip".
A button in a Godot 4 scene reaches down a USB cable — through a Python-to-UDP bridge — and lights a real LED on an Arduino Uno.
Contents
arduino/
LedBasics/LedBasics.ino # reads L1/L0 off serial, drives the LED on D13
bridge/bridge.py # serial <-> UDP relay (run this, leave it running)
bridge/ledtest.py # quick standalone LED blink test (no Godot)
godot/
ArduinoGodot/ # Godot 4 project: one styled toggle button
Wiring
D13 → 220 Ω resistor → LED long leg (anode); LED short leg (cathode) → GND. No breadboard? The Uno's onboard LED is already on D13.
Run it
- Flash
arduino/LedBasics/LedBasics.inoto the Uno (Arduino IDE, 115200 baud). - Bridge:
pip install pyserial, thenpython arduino/bridge/bridge.py. Leave it running. - Godot: open
godot/ArduinoGodot/in Godot 4, press Play, click the button.
The bridge auto-detects the board and reconnects if the cable pops out.