The µBitx morse key input is a bit strange. There is only one wire going up into the Arduino Nano's analog input (Pin A6). That seem good enough for the straight key. What about Iambic paddle?

Turns out that one need to use two extra resistors, a 2.2k and a 10k resistors, 2.2k connected to the pins coming out of the dot paddle and a 10k to the dash paddle. There is already a 4.7k pullup resistor on the pin A6. So, either of these two resistors form the bottom part of a voltage divider circuit. There are four cases:

1. Straight key

Let us calculate the voltages generated for each of these cases. In case #1, voltage goes to zero on key down.

In case #2, on pressing the dot paddle, one end of the 2.2k resistor gets grounded. The current from 5v, through the resistors 4.7k and 2.2k and voltage drop across 2.2k is around 1.6 volts.

In case #3, on pressing dash paddle, one end of the 10k is grounded. Voltage drop across the resistor is around 3.4v.

In case #4, both the keys are pressed, so 10k and 2.2k are in parallel, effectively having a resistance of around 1.8k. Voltage drop across it is then around 1.38v.

This voltage is read by the ADC. The ADC resolution is 10-bits and any voltage between 0 and 5v is transformed into a 10-bit value uniformly. Rest is done in software