Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cw-usb

A tiny USB HID adapter for a CW (Morse) paddle. It reads the two paddle contacts and reports them as Left Ctrl / Right Ctrl key presses over USB, so any keyboard-based CW keyer software can use a real paddle as input.

seeduino-cw-usb

How it works

Each paddle contact shorts its pin to ground when squeezed. The microcontroller uses internal pull-ups, debounces the input, and sends a USB HID key press/release for as long as the contact stays closed:

  • Left paddle (dit) → Left Ctrl
  • Right paddle (dah) → Right Ctrl

See src/main.cpp for the implementation.

Configuration

Board-specific and behavioral settings live in include/, not in src/main.cpp, so they can be tweaked without touching the logic:

  • include/pins.h — which pins the paddle is wired to:
    • PIN_LEFT (default 2) — dit contact
    • PIN_RIGHT (default 4) — dah contact
  • include/config.h — keyer behavior:
    • PADDLE_LEFT_KEY (default KEY_LEFT_CTRL) — key sent for the left paddle
    • PADDLE_RIGHT_KEY (default KEY_RIGHT_CTRL) — key sent for the right paddle
    • DEBOUNCE_MS (default 5) — software debounce time in milliseconds
    • Any key supported by Keyboard.h can be used for PADDLE_LEFT_KEY / PADDLE_RIGHT_KEY.

Hardware

  • Seeeduino XIAO (default target, env:xiao) or Arduino Leonardo (env:leonardo) — both have native USB and can act as a USB HID keyboard.
  • A CW paddle (iambic or single-lever) with a common ground return.

Wiring

                      ┌──────────────────────┐
                      │   Seeeduino XIAO /   │
                      │   Arduino Leonardo   │
                      │                      │
        Dit ──────────┤ D2                   │
                      │                      │
        Dah ──────────┤ D4                   │
                      │                      │
      Common ─────────┤ GND                  │
                      │                      │
                      │                 USB  ├──── to computer
                      └──────────────────────┘
  • D2 = dit (left paddle) contact (PIN_LEFT in include/pins.h)
  • D4 = dah (right paddle) contact (PIN_RIGHT in include/pins.h)
  • Paddle common ⟶ board GND
  • No external resistors needed — the firmware enables internal pull-ups on PIN_LEFT and PIN_RIGHT.
  • If you rewire to different pins, update include/pins.h to match.

Build & upload

This is a PlatformIO project.

# build + upload to the default env (xiao)
pio run -t upload

# or target the Leonardo
pio run -e leonardo -t upload

License

MIT — see LICENSE.

About

Simple Arduino project that converts paddle presses from a CW Key to control characters for computer based practice.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages