aboutsummaryrefslogtreecommitdiff
path: root/docs/features/encoders.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/features/encoders.md')
-rw-r--r--docs/features/encoders.md36
1 files changed, 18 insertions, 18 deletions
diff --git a/docs/features/encoders.md b/docs/features/encoders.md
index 9157fe67c8..a674eaa4a6 100644
--- a/docs/features/encoders.md
+++ b/docs/features/encoders.md
@@ -9,15 +9,15 @@ ENCODER_ENABLE = yes
and this to your `config.h`:
```c
-#define ENCODERS_PAD_A { B12 }
-#define ENCODERS_PAD_B { B13 }
+#define ENCODER_A_PINS { B12 }
+#define ENCODER_B_PINS { B13 }
```
Each PAD_A/B variable defines an array so multiple encoders can be defined, e.g.:
```c
-#define ENCODERS_PAD_A { encoder1a, encoder2a }
-#define ENCODERS_PAD_B { encoder1b, encoder2b }
+#define ENCODER_A_PINS { encoder1a, encoder2a }
+#define ENCODER_B_PINS { encoder1b, encoder2b }
```
If your encoder's clockwise directions are incorrect, you can swap the A & B pad definitions. They can also be flipped with a define:
@@ -49,8 +49,8 @@ For 4× encoders you also can assign default position if encoder skips pulses wh
If you are using different pinouts for the encoders on each half of a split keyboard, you can define the pinout (and optionally, resolutions) for the right half like this:
```c
-#define ENCODERS_PAD_A_RIGHT { encoder1a, encoder2a }
-#define ENCODERS_PAD_B_RIGHT { encoder1b, encoder2b }
+#define ENCODER_A_PINS_RIGHT { encoder1a, encoder2a }
+#define ENCODER_B_PINS_RIGHT { encoder1b, encoder2b }
#define ENCODER_RESOLUTIONS_RIGHT { 2, 4 }
```
@@ -59,11 +59,11 @@ If the `_RIGHT` definitions aren't specified in your `config.h`, then the non-`_
Additionally, if one side does not have an encoder, you can specify `{}` for the pins/resolution -- for example, a split keyboard with only a right-side encoder:
```c
-#define ENCODERS_PAD_A { }
-#define ENCODERS_PAD_B { }
+#define ENCODER_A_PINS { }
+#define ENCODER_B_PINS { }
#define ENCODER_RESOLUTIONS { }
-#define ENCODERS_PAD_A_RIGHT { B12 }
-#define ENCODERS_PAD_B_RIGHT { B13 }
+#define ENCODER_A_PINS_RIGHT { B12 }
+#define ENCODER_B_PINS_RIGHT { B13 }
#define ENCODER_RESOLUTIONS_RIGHT { 4 }
```
@@ -84,10 +84,10 @@ Your `keymap.c` will then need an encoder mapping defined (for four layers and t
```c
#if defined(ENCODER_MAP_ENABLE)
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
- [0] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
- [1] = { ENCODER_CCW_CW(UG_HUED, UG_HUEU), ENCODER_CCW_CW(UG_SATD, UG_SATU) },
- [2] = { ENCODER_CCW_CW(UG_VALD, UG_VALU), ENCODER_CCW_CW(UG_SPDD, UG_SPDU) },
- [3] = { ENCODER_CCW_CW(UG_PREV, UG_NEXT), ENCODER_CCW_CW(KC_RIGHT, KC_LEFT) },
+ [0] = { ENCODER_CCW_CW(MS_WHLU, MS_WHLD), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
+ [1] = { ENCODER_CCW_CW(UG_HUED, UG_HUEU), ENCODER_CCW_CW(UG_SATD, UG_SATU) },
+ [2] = { ENCODER_CCW_CW(UG_VALD, UG_VALU), ENCODER_CCW_CW(UG_SPDD, UG_SPDU) },
+ [3] = { ENCODER_CCW_CW(UG_PREV, UG_NEXT), ENCODER_CCW_CW(KC_RIGHT, KC_LEFT) },
};
#endif
```
@@ -174,13 +174,13 @@ Multiple encoders may share pins so long as each encoder has a distinct pair of
For example you can support two encoders using only 3 pins like this
```
-#define ENCODERS_PAD_A { B1, B1 }
-#define ENCODERS_PAD_B { B2, B3 }
+#define ENCODER_A_PINS { B1, B1 }
+#define ENCODER_B_PINS { B2, B3 }
```
You could even support three encoders using only three pins (one per encoder) however in this configuration, rotating two encoders which share pins simultaneously will often generate incorrect output. For example:
```
-#define ENCODERS_PAD_A { B1, B1, B2 }
-#define ENCODERS_PAD_B { B2, B3, B3 }
+#define ENCODER_A_PINS { B1, B1, B2 }
+#define ENCODER_B_PINS { B2, B3, B3 }
```
Here rotating Encoder 0 `B1 B2` and Encoder 1 `B1 B3` could be interpreted as rotating Encoder 2 `B2 B3` or `B3 B2` depending on the timing. This may still be a useful configuration depending on your use case