-
Notifications
You must be signed in to change notification settings - Fork 0
Home
OOFy-OOF edited this page Jul 20, 2025
·
7 revisions
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)
| Component | Pin | Notes |
|---|---|---|
| Potentiometer | A0 | 10kฮฉ recommended |
| Mode Button | 10 | INPUT_PULLUP |
| Confirm Button | 11 | INPUT_PULLUP |
| ESC Button | 12 | INPUT_PULLUP |
const char* modes[] = {
"abcdefghijklmnopqrstuvwxyz", // Mode 0
"ABCDEFGHIJKLMNOPQRSTUVWXYZ", // Mode 1
"0123456789$%#@&", // Mode 2
".,!?;:'\"-()/\\ " // Mode 3
};| 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 |
| Action | Effect |
|---|---|
| Short Press | Prints selected character |
| Long Press (300ms+) | Prints space character |
| Action | Effect |
|---|---|
| Short Press | "ESC" command |
| Long Press (300ms+) | "Backspace" command |
Selected: [a] | Mode: Lowercase Letters
Confirmed: b
Caps Lock: ON
Backspace
Enter
Space inserted
const int holdDelay = 300; // Long-press threshold (ms)
const int doublePressDelay = 500; // Double-press window (ms)
const int potRange = 670; // Potentiometer range (0-potRange)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
The system tracks:
-
currentMode(0-3) -
capsLock(boolean) -
selectedCharIndex(0 to strlen(currentMode)-1) -
lastPrintedCharIndex(for change detection) -
lastPrintedMode(for change detection)
- Rotate dial to 'A'
- Short-press Confirm โ "Confirmed: A"
- Long-press Mode โ "Caps Lock: ON"
- Double-press Mode โ "Enter"
- Long-press ESC โ "Backspace"
| 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