6 380 Feature: Keypad
VK2EFL edytuje tę stronę 2021-05-20 13:15:56 +10:00

A 3x4 or 4x4 membrane keypad can be substituted for the pushbutton memory switches, but the MEMORY buttons can be retained and used with no effects on the COMMAND/MEMORY functions.

Note that the keypad is not a full replacement for the memory buttons. The ability to switch the output transmitter line by holding a memory button is not supported by the keypad as the keypad does not recognize a 'hold' of the keypad button. Also the ability to put a memory into repeat by pressing a memory button and tapping the left paddle, is not available from the keypad since it doesn't recognise the keypad button hold and simultaneous paddle tap.

By removing the MEMORY switches, the pushbuttons and 1k resistors can be eliminated. The 10k resistor to +5 vdc is still used as the COMMAND pushbutton (button 0) switch is retained.

To use a 3x4 or 4x4 keypad: In “features and options.h”, uncomment the proper keypad and comment out the unused one.

Keypad buttons 1 through 0 access the memories, (0 is for memory 10). Additionally if using a 4x4 keypad, the “A, B, C, D, #, *” keys could be used for any number of functions (by changing the source code in the .ino sketch). Likewise on the 3x4 keypad, the “#, *” buttons can be programmed for memories 11 and 12, or they could be programmed to invoke another function. Just follow the SWITCH/CASE statements in the KeyPad_use() subroutine. I programmed the “C” key to put the keyer into COMMAND MODE. To exit that mode, push the COMMAND button or send an “X” on the key. The COMMAND_MODE() subroutine does not look at the keypad, so pushbutton 0 or keyed “X” must be used to exit Command Mode. All 12 memories can be used with the keypad and all memories respond to MEMORY MACROS.

In the CASE statements, unused keys are programmed to “beep-boop” to indicate this is an unused key or unused keys can be commented out.

The code shows the proper OUTPUT pins on the Arduino Mega 2560 to use with either keypad and the ROW/COLUMN pins on the keypads.

Code and wiki text contributed by W0XR