diff options
| author | Jack Humbert <jack.humb@gmail.com> | 2018-10-26 16:47:00 -0400 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2018-10-26 14:24:13 -0700 |
| commit | 24b3556e844ec76813a42ce4c5b7a77a6f874d5a (patch) | |
| tree | a070897eaa08da40957fa08818843ac687b6ad32 | |
| parent | 85688e5b52112c86895171d3dc8b26610480e932 (diff) | |
| download | qmk_firmware-24b3556e844ec76813a42ce4c5b7a77a6f874d5a.tar.gz qmk_firmware-24b3556e844ec76813a42ce4c5b7a77a6f874d5a.zip | |
add better example
| -rw-r--r-- | docs/feature_encoders.md | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/docs/feature_encoders.md b/docs/feature_encoders.md index f482eefec..036c6a1d8 100644 --- a/docs/feature_encoders.md +++ b/docs/feature_encoders.md | |||
| @@ -32,10 +32,17 @@ The callback functions can be inserted into your `<keyboard>.c`: | |||
| 32 | or `keymap.c`: | 32 | or `keymap.c`: |
| 33 | 33 | ||
| 34 | void encoder_update_user(uint8_t index, bool clockwise) { | 34 | void encoder_update_user(uint8_t index, bool clockwise) { |
| 35 | 35 | if (index == 0) { | |
| 36 | if (clockwise) { | ||
| 37 | register_code(KC_PGDN); | ||
| 38 | unregister_code(KC_PGDN); | ||
| 39 | } else { | ||
| 40 | register_code(KC_PGUP); | ||
| 41 | unregister_code(KC_PGUP); | ||
| 42 | } | ||
| 43 | } | ||
| 36 | } | 44 | } |
| 37 | 45 | ||
| 38 | |||
| 39 | ## Hardware | 46 | ## Hardware |
| 40 | 47 | ||
| 41 | The A an B lines of the encoders should be wired directly to the MCU, and the C/common lines should be wired to ground. | 48 | The A an B lines of the encoders should be wired directly to the MCU, and the C/common lines should be wired to ground. |
