From 28339f198f4dbcca937be8a9fb224630e523e843 Mon Sep 17 00:00:00 2001 From: tyler parker Date: Sun, 9 Aug 2026 21:39:43 +0000 Subject: [PATCH] Add double-click bridge launchers; document ledtest + launchers in READMEs start-bridge.bat (Windows) and start-bridge.command (macOS/Linux, +x) sit next to bridge.py in both parts so readers can start the bridge with a double-click. READMEs now cover the launchers and the ledtest.py debug path. --- godot-arduino-1-led-first-light/README.md | 18 +++++++++++++----- .../arduino/bridge/start-bridge.bat | 8 ++++++++ .../arduino/bridge/start-bridge.command | 6 ++++++ godot-arduino-2-joystick-dashboard/README.md | 10 ++++++---- .../arduino/bridge/start-bridge.bat | 8 ++++++++ .../arduino/bridge/start-bridge.command | 6 ++++++ 6 files changed, 47 insertions(+), 9 deletions(-) create mode 100644 godot-arduino-1-led-first-light/arduino/bridge/start-bridge.bat create mode 100755 godot-arduino-1-led-first-light/arduino/bridge/start-bridge.command create mode 100644 godot-arduino-2-joystick-dashboard/arduino/bridge/start-bridge.bat create mode 100755 godot-arduino-2-joystick-dashboard/arduino/bridge/start-bridge.command diff --git a/godot-arduino-1-led-first-light/README.md b/godot-arduino-1-led-first-light/README.md index f0e5903..1819bb8 100644 --- a/godot-arduino-1-led-first-light/README.md +++ b/godot-arduino-1-led-first-light/README.md @@ -9,11 +9,13 @@ bridge — and lights a real LED on an Arduino Uno. ``` 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) + 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/start-bridge.bat # Windows: double-click to start the bridge + bridge/start-bridge.command # macOS/Linux: double-click (or ./) to start the bridge + bridge/ledtest.py # standalone LED command test, no Godot (see Debugging) godot/ - ArduinoGodot/ # Godot 4 project: one styled toggle button + ArduinoGodot/ # Godot 4 project: one styled toggle button ``` ## Wiring @@ -24,7 +26,13 @@ No breadboard? The Uno's onboard LED is already on D13. ## Run it 1. **Flash** `arduino/LedBasics/LedBasics.ino` to the Uno (Arduino IDE, 115200 baud). -2. **Bridge:** `pip install pyserial`, then `python arduino/bridge/bridge.py`. Leave it running. +2. **Bridge:** `pip install pyserial`, then start the relay and leave it running — either **double-click `arduino/bridge/start-bridge.bat`** (Windows) / **`arduino/bridge/start-bridge.command`** (macOS), or run `python arduino/bridge/bridge.py` yourself. 3. **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. + +> **Tip — one-click launch:** the `start-bridge.*` files just run `bridge.py` from a double-click, so you skip the terminal each session. On Windows, right-click `start-bridge.bat` → *Send to → Desktop (create shortcut)*. On macOS, if double-clicking opens it in an editor instead of running, mark it executable once: `chmod +x start-bridge.command`. + +## Debugging + +If the LED won't light and you can't tell whether it's Godot or the bridge, run `python arduino/bridge/ledtest.py L1` with the bridge running. It fires an `L1`/`L0` command straight at the bridge's command port, exactly like Godot does. **LED lights** → the Arduino and bridge are fine, so the fault is on Godot's side. **Stays dark** → the problem is the bridge or the wiring, and Godot is off the hook. diff --git a/godot-arduino-1-led-first-light/arduino/bridge/start-bridge.bat b/godot-arduino-1-led-first-light/arduino/bridge/start-bridge.bat new file mode 100644 index 0000000..30c832e --- /dev/null +++ b/godot-arduino-1-led-first-light/arduino/bridge/start-bridge.bat @@ -0,0 +1,8 @@ +@echo off +REM Double-click to start the Godot <-> Arduino serial bridge (Windows). +REM Keep this window open while you work; close it to stop the bridge. +cd /d "%~dp0" +py bridge.py +echo. +echo Bridge stopped. Press any key to close this window. +pause >nul diff --git a/godot-arduino-1-led-first-light/arduino/bridge/start-bridge.command b/godot-arduino-1-led-first-light/arduino/bridge/start-bridge.command new file mode 100755 index 0000000..0ce181f --- /dev/null +++ b/godot-arduino-1-led-first-light/arduino/bridge/start-bridge.command @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +# Double-click in Finder (macOS) to start the Godot <-> Arduino serial bridge. +# Keep this window open while you work; close it to stop the bridge. +# On Linux this same file works once it's executable: chmod +x start-bridge.command +cd "$(dirname "$0")" +python3 bridge.py diff --git a/godot-arduino-2-joystick-dashboard/README.md b/godot-arduino-2-joystick-dashboard/README.md index 62f45d3..8be744b 100644 --- a/godot-arduino-2-joystick-dashboard/README.md +++ b/godot-arduino-2-joystick-dashboard/README.md @@ -10,10 +10,12 @@ stick across an XY pad in real time, with the LED button still working. ``` arduino/ - JoystickBridge/JoystickBridge.ino # streams "x,y,btn" + still drives the LED - bridge/bridge.py # same serial <-> UDP relay as Part 1 + JoystickBridge/JoystickBridge.ino # streams "x,y,btn" + still drives the LED + bridge/bridge.py # same serial <-> UDP relay as Part 1 + bridge/start-bridge.bat # Windows: double-click to start the bridge + bridge/start-bridge.command # macOS/Linux: double-click (or ./) to start the bridge godot/ - ArduinoGodot/ # Godot 4 project: XY pad + dot + LED button + ArduinoGodot/ # Godot 4 project: XY pad + dot + LED button ``` ## Wiring (adds to Part 1) @@ -24,5 +26,5 @@ LED from Part 1 on D13. ## Run it 1. **Flash** `arduino/JoystickBridge/JoystickBridge.ino` to the Uno. -2. **Bridge:** `python arduino/bridge/bridge.py` (leave running). +2. **Bridge:** double-click `arduino/bridge/start-bridge.bat` (Windows) / `arduino/bridge/start-bridge.command` (macOS), or run `python arduino/bridge/bridge.py`. Leave it running. 3. **Godot:** open `godot/ArduinoGodot/` in Godot 4 and press Play — move the stick. diff --git a/godot-arduino-2-joystick-dashboard/arduino/bridge/start-bridge.bat b/godot-arduino-2-joystick-dashboard/arduino/bridge/start-bridge.bat new file mode 100644 index 0000000..30c832e --- /dev/null +++ b/godot-arduino-2-joystick-dashboard/arduino/bridge/start-bridge.bat @@ -0,0 +1,8 @@ +@echo off +REM Double-click to start the Godot <-> Arduino serial bridge (Windows). +REM Keep this window open while you work; close it to stop the bridge. +cd /d "%~dp0" +py bridge.py +echo. +echo Bridge stopped. Press any key to close this window. +pause >nul diff --git a/godot-arduino-2-joystick-dashboard/arduino/bridge/start-bridge.command b/godot-arduino-2-joystick-dashboard/arduino/bridge/start-bridge.command new file mode 100755 index 0000000..0ce181f --- /dev/null +++ b/godot-arduino-2-joystick-dashboard/arduino/bridge/start-bridge.command @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +# Double-click in Finder (macOS) to start the Godot <-> Arduino serial bridge. +# Keep this window open while you work; close it to stop the bridge. +# On Linux this same file works once it's executable: chmod +x start-bridge.command +cd "$(dirname "$0")" +python3 bridge.py