How ppw0021/key_pro works
Project type and purpose
• This is an embedded hardware-software project: a DIY, split ergonomic keyboard built around three Arduinos (one master Arduino Leonardo and two slave Arduino Pro Micros).
• Purpose: scan key matrices on left/right halves, communicate via I2C to master, and emulate a USB HID keyboard to a host computer.
File structure
• Top-level directories:
• master/ ← firmware for the Leonardo master controller
• slave_left/ ← firmware for left Pro Micro
• slave_right/ ← firmware for right Pro Micro
• matrix/ ← single-file sketch (probably legacy or reference .ino)
• .gitignore, platformio.ini files in each firmware folder → PlatformIO+VSCode projects
• master/src/main.cpp contains I2C polling loops, HID Keyboard library usage, keyMap & keyState arrays.
• slave_{left,right}/src/main.cpp contain identical matrix-scanning code with different keyMatrixMap definitions and I2C addresses (5 and 6).
Key README insights
• Master ↔ slaves communicate over I2C; master polls each slave for a 30-byte key-state update.
• Each slave uses a 6-column × 5-row key matrix to detect presses/releases, records state changes, and responds to master requests with ASCII codes or 255 for no-change.
• Master translates ASCII codes via keyMap to HID keypress events on the host computer.
Detailed capture of essential elements
• Pin-mapping callouts for the key matrix (colToPinArray & rowToPinArray) if needed for low-level hardware docs.
• Polling delays (delay(5), delay(10)) to show timing constraints.