Skip to content

Latest commit

 

History

History
234 lines (189 loc) · 6.09 KB

File metadata and controls

234 lines (189 loc) · 6.09 KB

Dit and Dah Paddle Swap Fixed

Problem Fixed

The left and right paddles were reversed - dit and dah were swapped from the standard iambic paddle configuration.

Standard Iambic Paddle Configuration

In standard Morse code paddles:

  • Left paddle (operated by thumb) = DAH (dash, -)
  • Right paddle (operated by index finger) = DIT (dot, .)

This is the universal standard used by:

  • Commercial paddle manufacturers (Bencher, Vibroplex, GHD, etc.)
  • Ham radio operators worldwide
  • CW Academy training materials
  • All electronic keyers

What Was Wrong

Before the fix:

  • Left paddle → DIT (dot, .) ❌ WRONG!
  • Right paddle → DAH (dash, -) ❌ WRONG!

After the fix:

  • Left paddle → DAH (dash, -) ✅ CORRECT!
  • Right paddle → DIT (dot, .) ✅ CORRECT!

Changes Made

1. Fixed Paddle Logic in automatic_keyer_thread()

File: src/main.rs

Before (WRONG):

if left_pressed {
    // Generate DIT
    decoder.lock().unwrap().add_element(true);  // Wrong!
    thread::sleep(Duration::from_millis(dit_ms as u64));
} else if right_pressed {
    // Generate DAH
    decoder.lock().unwrap().add_element(false);  // Wrong!
    thread::sleep(Duration::from_millis(dah_ms as u64));
}

After (CORRECT):

if left_pressed {
    // Generate DAH (left paddle = thumb = dah)
    decoder.lock().unwrap().add_element(false);  // Correct!
    thread::sleep(Duration::from_millis(dah_ms as u64));
} else if right_pressed {
    // Generate DIT (right paddle = finger = dit)
    decoder.lock().unwrap().add_element(true);  // Correct!
    thread::sleep(Duration::from_millis(dit_ms as u64));
}

2. Updated UI Labels

Before (WRONG):

LEFT (Dit)   RIGHT (Dah)

After (CORRECT):

LEFT (Dah)   RIGHT (Dit)

How the Code Works

add_element() Function

fn add_element(&mut self, is_dit: bool) {
    if is_dit {
        self.current_sequence.push('.');  // Dit = dot
    } else {
        self.current_sequence.push('-');  // Dah = dash
    }
}

Correct Flow Now

Left paddle pressed
  ↓
left_pressed = true
  ↓
add_element(false)  ← false = dah
  ↓
push('-')  ← dash added
  ↓
Play 3-unit tone
Right paddle pressed
  ↓
right_pressed = true
  ↓
add_element(true)  ← true = dit
  ↓
push('.')  ← dot added
  ↓
Play 1-unit tone

Testing the Fix

Test Character: A (dit-dah, ·-)

Correct sequence:

  1. Press RIGHT paddle (dit) → hear short beep, see .
  2. Press LEFT paddle (dah) → hear long beep, see .-
  3. Wait for timeout → see "A" decoded

Test Character: N (dah-dit, -·)

Correct sequence:

  1. Press LEFT paddle (dah) → hear long beep, see -
  2. Press RIGHT paddle (dit) → hear short beep, see -.
  3. Wait for timeout → see "N" decoded

Test Character: T (dah, -)

Correct sequence:

  1. Press LEFT paddle (dah) → hear long beep, see -
  2. Wait for timeout → see "T" decoded

Test Character: E (dit, ·)

Correct sequence:

  1. Press RIGHT paddle (dit) → hear short beep, see .
  2. Wait for timeout → see "E" decoded

Why This Matters

1. Muscle Memory

  • Operators trained on standard paddles would have incorrect muscle memory
  • Training on reversed paddles would hurt performance on real equipment
  • Retraining muscle memory is difficult and frustrating

2. Universal Compatibility

  • All commercial paddles use this standard
  • All electronic keyers expect this configuration
  • CW Academy curriculum assumes this setup
  • Contest operators use this standard

3. Ergonomics

  • Right hand index finger is more dexterous (dits are more frequent)
  • Thumb naturally applies more pressure (dahs need more emphasis)
  • This is why the standard evolved this way

4. Learning

  • Beginners need correct associations from day one
  • Wrong habits are hard to break
  • Standard configuration matches training materials

Character Examples

With the correct configuration:

Letter "A" (·-)

RIGHT (dit)  LEFT (dah)
   ·           -
   └──────────┘
        A

Letter "K" (-·-)

LEFT (dah)  RIGHT (dit)  LEFT (dah)
   -           ·           -
   └───────────┴───────────┘
              K

Letter "S" (···)

RIGHT  RIGHT  RIGHT
  ·      ·      ·
  └──────┴──────┘
        S

Letter "O" (---)

LEFT  LEFT  LEFT
  -     -     -
  └─────┴─────┘
       O

Visual Confirmation

The UI now correctly shows:

┌────────────────────────────────────┐
│  Paddle Status:                    │
│  LEFT (Dah)       RIGHT (Dit)      │
│  └─ dash/─       └─ dot/·          │
└────────────────────────────────────┘

When you press:

  • Left paddle → "LEFT (Dah)" turns RED, hear long tone, see -
  • Right paddle → "RIGHT (Dit)" turns RED, hear short tone, see .

Benefits of the Fix

Correct standard - Matches worldwide iambic paddle convention
Proper training - Builds correct muscle memory
Universal compatibility - Works with all standard equipment
Ergonomic - Right configuration for hand mechanics
CW Academy aligned - Matches curriculum expectations

Comparison

Aspect Before (WRONG) After (CORRECT)
Left paddle Dit (·) Dah (-)
Right paddle Dah (-) Dit (·)
UI label left "LEFT (Dit)" "LEFT (Dah)"
UI label right "RIGHT (Dah)" "RIGHT (Dit)"
Standard compliance ❌ No ✅ Yes
Muscle memory ❌ Wrong ✅ Correct
CW Academy compatible ❌ No ✅ Yes

Summary

Problem: Paddles were reversed from standard iambic configuration
Solution: Swapped dit/dah assignment in code and UI
Result: Now matches universal standard used by all ham radio operators

The paddles now work correctly according to the worldwide standard - left paddle for dashes, right paddle for dots!