Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Morse Trainer

A Morse code decoder written in Rust. Supports two input modes: a physical button via GPIO (embedded board) or the spacebar on a standard Linux keyboard.


Install dependencies

sudo apt-get install build-essential
sudo apt-get install libc6-dev-riscv64-cross
sudo apt-get install gcc-riscv64-linux-gnu

Note

For keyboard mode, make sure your user is in the input group so you can read /dev/input/event* without root:

sudo usermod -aG input $USER
# Log out and back in for the change to take effect

Build

Keyboard mode (standard Linux PC)

cargo build --release --features keyboard

GPIO mode (embedded board)

cargo build --release --features gpio

Both modes available in the same binary

cargo build --release --features gpio,keyboard

Run

Keyboard mode — hold SPACE to transmit, release 2 s to decode

./target/release/morse --input keyboard

GPIO mode — physical button on the board

./target/release/morse --input gpio

How it works

Hold the button/key for a short time to send a dot ·, hold longer for a dash . The decoder calculates the dot/dash threshold automatically from your own rhythm, so no manual calibration is needed.

Signal Duration
Dot 1 unit
Dash 3 units
Gap between symbols 1 unit
Gap between letters 3 units
Gap between words 7 units

After 2 seconds of silence the current sequence is decoded and printed.


Logging

Set the RUST_LOG environment variable to control verbosity:

RUST_LOG=debug ./target/release/morse --input keyboard   # show every pulse
RUST_LOG=info  ./target/release/morse --input keyboard   # decoded text only

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages