How mintythecoder/ksp-macropad works
KSP MacroPad is a physical control surface and companion Kerbal Space Program plugin: button presses and encoder turns travel from the CircuitPython pad over USB serial, trigger in-game procedures, and return game-state feedback for the pad’s LEDs and OLED. The README documents a broad set of flight macros, telemetry, and optional compatibility checks. Sampled firmware and mod excerpts support the serial, input, and feedback links; macro capabilities and hardware design are documented, but their full implementation was not sampled.
Main entry points: KSPMacropad.cs Port discovery and framing · KSPMacroPad.kicad_pcb MacroPad · code.py USB serial protocol · KSPMacropad Flight procedures
Components 18
Pad hardware
- MacroPad
PCB/KSPMacroPad.kicad_pcb - PCB and components
PCB/KSPMacroPad.kicad_sch
Pad firmware
- Key and encoder input
Firmware/code.py - USB serial protocol
Firmware/code.py - LED and OLED feedback
Firmware/code.py - LED state constants
Firmware/led_states.py - USB CDC setup
Firmware/boot.py
KSP plugin
- Port discovery and framing
mod/KSPMacropad/KSPMacropad.cs - Macro dispatch and queue
mod/KSPMacropad/KSPMacropad.cs - Flight procedures
mod/KSPMacropad - Game state and telemetry
mod/KSPMacropad/KSPMacropad.cs - LED and telemetry updates
mod/KSPMacropad/KSPMacropad.cs - LED state constants
mod/KSPMacropad/LEDStates.cs
Physical design
- Parametric case
CAD/ksp_macropad_case.scad - Printable case parts
production/case_bottom.stl
Other components
- Player
- Kerbal Space Program
- Optional KSP mods
Connections 18
- Player → MacroPad: operates
- MacroPad → Key and encoder input: provides inputs
- Key and encoder input → USB serial protocol: sends events
- USB CDC setup → USB serial protocol: enables data port
- USB serial protocol → Port discovery and framing: sends packets
- Port discovery and framing → Macro dispatch and queue: dispatches events
- Macro dispatch and queue → Flight procedures: starts procedures
- Flight procedures → Kerbal Space Program: controls vessel
- Kerbal Space Program → Game state and telemetry: provides live state
- Game state and telemetry → LED and telemetry updates: supplies telemetry
- LED and telemetry updates → Port discovery and framing: writes packets
- Port discovery and framing → LED and OLED feedback: sends updates
- LED and OLED feedback → MacroPad: drives LEDs and OLED
- LED state constants → LED and telemetry updates: defines states
- LED state constants → LED and OLED feedback: defines states
- Optional KSP mods → Flight procedures: may conflict
- PCB and components → MacroPad: defines circuitry
- Parametric case → Printable case parts: models parts