Skip to content
OOFy-OOF edited this page Jul 20, 2025 · 7 revisions

๐Ÿ“Œ Overview

The input device uses:

  • 1 Potentiometer for character selection
  • 3 Buttons for mode control and actions
  • 4 Character Modes (letters, numbers, symbols)
  • Advanced input detection (double-press, long-press)

๐Ÿ›  Hardware Setup

Component Pin Notes
Potentiometer A0 10kฮฉ recommended
Mode Button 10 INPUT_PULLUP
Confirm Button 11 INPUT_PULLUP
ESC Button 12 INPUT_PULLUP

๐Ÿ”ข Character Modes

๐Ÿ“œ List of characters

const char* modes[] = {
  "abcdefghijklmnopqrstuvwxyz",  // Mode 0
  "ABCDEFGHIJKLMNOPQRSTUVWXYZ",  // Mode 1 
  "0123456789$%#@&",             // Mode 2
  ".,!?;:'\"-()/\\ "             // Mode 3
};

๐ŸŽฎ Complete Control Reference

๐Ÿ”„ Mode Button (Pin 10)

Action Effect Technical Details
Single Press Cycles modes (0โ†’1โ†’2โ†’3โ†’0) currentMode = (currentMode + 1) % 4
Double Press Sends "Enter" if (millis() - lastModePressTime < 500ms)
Long Press (300ms+) Toggles CapsLock (Modes 0/1) capsLock = !capsLock

โœ… Confirm Button (Pin 11)

Action Effect
Short Press Prints selected character
Long Press (300ms+) Prints space character

โฎ ESC Button (Pin 12)

Action Effect
Short Press "ESC" command
Long Press (300ms+) "Backspace" command

๐Ÿ“Ÿ Serial Output Examples

Selected: [a] | Mode: Lowercase Letters
Confirmed: b
Caps Lock: ON
Backspace
Enter
Space inserted

โš™๏ธ Configuration Constants

const int holdDelay = 300;       // Long-press threshold (ms)
const int doublePressDelay = 500; // Double-press window (ms)
const int potRange = 670;        // Potentiometer range (0-potRange)

๐Ÿ”„ Mode Transition Logic

graph TD
    A[Lowercase] -->|Single Press| B[Uppercase]
    B -->|Single Press| C[Numbers/Symbols]
    C -->|Single Press| D[Punctuation]
    D -->|Single Press| A
    A <-->|Long Press| B
Loading

๐Ÿšฆ Status Tracking

The system tracks:

  • currentMode (0-3)
  • capsLock (boolean)
  • selectedCharIndex (0 to strlen(currentMode)-1)
  • lastPrintedCharIndex (for change detection)
  • lastPrintedMode (for change detection)

๐Ÿ•น Usage Example

  1. Rotate dial to 'A'
  2. Short-press Confirm โ†’ "Confirmed: A"
  3. Long-press Mode โ†’ "Caps Lock: ON"
  4. Double-press Mode โ†’ "Enter"
  5. Long-press ESC โ†’ "Backspace"

โš ๏ธ More Troubleshooting

Issue Solution
Characters skipping Check potentiometer wiring
Buttons not responding Verify INPUT_PULLUP enabled
Serial output lag Reduce loop() delay (currently 100ms)
Incorrect mode changes Calibrate holdDelay (300ms)

Refer to README for basic problems.


๐Ÿ“ See also: Main Repository | Schematic Diagram