From 9956da626376bd8ab0e6a4346f69afdac06a8c64 Mon Sep 17 00:00:00 2001 From: ploopyco Date: Thu, 12 Jun 2025 12:46:53 -0400 Subject: [PATCH] renamed; refactored --- keyboards/ploopyco/common/as5600.h | 16 +++++++++++++-- keyboards/ploopyco/dial/rev1_001/readme.md | 3 --- keyboards/ploopyco/{dial => knob}/config.h | 5 +---- keyboards/ploopyco/{dial => knob}/info.json | 2 +- .../{dial => knob}/keymaps/default/keymap.c | 13 ++++-------- .../ploopyco/{dial => knob}/post_rules.mk | 0 keyboards/ploopyco/{dial => knob}/readme.md | 20 +++++++++---------- .../{dial => knob}/rev1_001/keyboard.json | 0 keyboards/ploopyco/knob/rev1_001/readme.md | 3 +++ keyboards/ploopyco/ploopyco.c | 10 ++++------ 10 files changed, 36 insertions(+), 36 deletions(-) delete mode 100644 keyboards/ploopyco/dial/rev1_001/readme.md rename keyboards/ploopyco/{dial => knob}/config.h (85%) rename keyboards/ploopyco/{dial => knob}/info.json (94%) rename keyboards/ploopyco/{dial => knob}/keymaps/default/keymap.c (79%) rename keyboards/ploopyco/{dial => knob}/post_rules.mk (100%) rename keyboards/ploopyco/{dial => knob}/readme.md (64%) rename keyboards/ploopyco/{dial => knob}/rev1_001/keyboard.json (100%) create mode 100644 keyboards/ploopyco/knob/rev1_001/readme.md diff --git a/keyboards/ploopyco/common/as5600.h b/keyboards/ploopyco/common/as5600.h index 06c2dcbbdaa..68ac3cbe30f 100644 --- a/keyboards/ploopyco/common/as5600.h +++ b/keyboards/ploopyco/common/as5600.h @@ -16,12 +16,24 @@ #pragma once -#define POINTING_DEVICE_AS5600_ENABLE true - #include #include #include "i2c_master.h" +#define POINTING_DEVICE_AS5600_ENABLE true +#define POINTING_DEVICE_AS5600_TICK_COUNT 128 + +// 12 was found to be a good value experimentally, balancing good +// responsiveness with low backlash. +#define POINTING_DEVICE_AS5600_DEADZONE 12 + +// The speed divisor decreases the speed. 1 is base speed; 2 is divided by 2, +// 3 is divided by 3, and so forth. For best results, make sure that +// POINTING_DEVICE_AS5600_SPEED_DIV is an integer divisor of +// POINTING_DEVICE_AS5600_DEADZONE (i.e. 3 is an integer divisor of 12, but +// 5 is not). +#define POINTING_DEVICE_AS5600_SPEED_DIV 2 + #define AS5600_I2C_ADDRESS (0x36 << 1) #define REG_ZMCO 0x00 diff --git a/keyboards/ploopyco/dial/rev1_001/readme.md b/keyboards/ploopyco/dial/rev1_001/readme.md deleted file mode 100644 index 95bec623e81..00000000000 --- a/keyboards/ploopyco/dial/rev1_001/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -This is the R1.001 version of Dial. Future versions may have other features. - -See the [main readme](../readme.md) for more details. diff --git a/keyboards/ploopyco/dial/config.h b/keyboards/ploopyco/knob/config.h similarity index 85% rename from keyboards/ploopyco/dial/config.h rename to keyboards/ploopyco/knob/config.h index 880a985032c..ee69f242d78 100644 --- a/keyboards/ploopyco/dial/config.h +++ b/keyboards/ploopyco/knob/config.h @@ -1,6 +1,4 @@ -/* Copyright 2023 Colin Lam (Ploopy Corporation) - * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * Copyright 2019 Sunjun Kim +/* Copyright 2025 Colin Lam (Ploopy Corporation) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,4 +26,3 @@ { GP0, GP1, GP2, GP3, GP4, GP5, GP6, GP7, GP8, GP9, GP10, GP11, GP12, \ GP13, GP14, GP15, GP16, GP17, GP18, GP19, GP20, GP21, GP24, GP25, \ GP26, GP27, GP29 } - diff --git a/keyboards/ploopyco/dial/info.json b/keyboards/ploopyco/knob/info.json similarity index 94% rename from keyboards/ploopyco/dial/info.json rename to keyboards/ploopyco/knob/info.json index 0bbd23bb8bc..b1641f5772b 100644 --- a/keyboards/ploopyco/dial/info.json +++ b/keyboards/ploopyco/knob/info.json @@ -1,5 +1,5 @@ { - "keyboard_name": "Ploopy Dial", + "keyboard_name": "Ploopy Knob", "url": "www.ploopy.co", "maintainer": "ploopyco", "manufacturer": "Ploopy Corporation", diff --git a/keyboards/ploopyco/dial/keymaps/default/keymap.c b/keyboards/ploopyco/knob/keymaps/default/keymap.c similarity index 79% rename from keyboards/ploopyco/dial/keymaps/default/keymap.c rename to keyboards/ploopyco/knob/keymaps/default/keymap.c index 1e790a6bfc2..93c23584e1f 100644 --- a/keyboards/ploopyco/dial/keymaps/default/keymap.c +++ b/keyboards/ploopyco/knob/keymaps/default/keymap.c @@ -1,9 +1,4 @@ -/* TODO CHANGE LATER */ - - /* Copyright 2023 Colin Lam (Ploopy Corporation) - * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * Copyright 2019 Sunjun Kim * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,8 +20,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {{{ KC_NO }}}; void keyboard_post_init_user(void) { // Customise these values to desired behaviour - debug_enable=true; - debug_matrix=true; - debug_keyboard=true; - debug_mouse=true; + // debug_enable=true; + // debug_matrix=true; + // debug_keyboard=true; + // debug_mouse=true; } diff --git a/keyboards/ploopyco/dial/post_rules.mk b/keyboards/ploopyco/knob/post_rules.mk similarity index 100% rename from keyboards/ploopyco/dial/post_rules.mk rename to keyboards/ploopyco/knob/post_rules.mk diff --git a/keyboards/ploopyco/dial/readme.md b/keyboards/ploopyco/knob/readme.md similarity index 64% rename from keyboards/ploopyco/dial/readme.md rename to keyboards/ploopyco/knob/readme.md index e8ccacb5f6b..6629726e86b 100644 --- a/keyboards/ploopyco/dial/readme.md +++ b/keyboards/ploopyco/knob/readme.md @@ -1,16 +1,14 @@ -/* TODO CHANGE LATER */ +# Ploopyco Knob -# Ploopyco Madromys Trackball - -It's a DIY, QMK-powered trackball! +It's a DIY, QMK-powered knob! * Keyboard Maintainer: [PloopyCo](https://github.com/ploopyco) * Hardware Supported: RP2040 -* Hardware Availability: [Store](https://ploopy.co), [GitHub](https://github.com/ploopyco) +* Hardware Availability: [Store](https://ploopy.co/knob), [GitHub](https://github.com/ploopyco) Make example for this keyboard (after setting up your build environment): - qmk compile -kb ploopyco/madromys -km default + qmk compile -kb ploopyco/knob/rev1_001 -km default # Building Firmware @@ -20,14 +18,14 @@ See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_to [Do you see those two golden holes in the board](https://ploopy.co/wp-content/uploads/2023/11/boot.jpg)? Those are called **vias**. They act exactly like a switch does. Right now, that switch is OFF. However, if you take a paperclip or a pair of metal tweezers and touch those two vias, the two vias will form an electrical connection. Effectively, that switch turns ON. -Go ahead and connect the two vias, and then (while the vias are connected) plug in the Madromys board into your computer. +Go ahead and connect the two vias, and then (while the vias are connected) plug in the Knob board into your computer. -The computer should recognise that a mass storage device was just plugged in. Once this is done, you should be able to drag and drop files onto the Madromys board, as if the board was a USB drive. Feel free to remove the tweezers or paperclip at this point. +The computer should recognise that a mass storage device was just plugged in. Once this is done, you should be able to drag and drop files onto the Knob board, as if the board was a USB drive. Feel free to remove the tweezers or paperclip at this point. -If you want to upload a new firmware file (a ".uf2" file, like "madromys_awesome_version.uf2" or something), just drag it into the folder, and it'll automatically install on the Madromys board and restart itself, in normal operating mode. You're done! +If you want to upload a new firmware file (a ".uf2" file, like "knob_awesome_version.uf2" or something), just drag it into the folder, and it'll automatically install on the Knob board and restart itself, in normal operating mode. You're done! -**TIP**: If your firmware is in some kind of strange state and uploading new firmware isn't fixing it, try uploading [a flash nuke](https://learn.adafruit.com/getting-started-with-raspberry-pi-pico-circuitpython/circuitpython#flash-resetting-uf2-3083182) to the Madromys board before flashing the new firmware. It wipes the memory of the Madromys board completely clean, which can help clear a few types of errors. +**TIP**: If your firmware is in some kind of strange state and uploading new firmware isn't fixing it, try uploading [a flash nuke](https://learn.adafruit.com/getting-started-with-raspberry-pi-pico-circuitpython/circuitpython#flash-resetting-uf2-3083182) to the Knob board before flashing the new firmware. It wipes the memory of the Knob board completely clean, which can help clear a few types of errors. -# Customizing your Ploopy Madromys +# Customizing your Ploopy Knob You can find customziation options [here](../readme.md). diff --git a/keyboards/ploopyco/dial/rev1_001/keyboard.json b/keyboards/ploopyco/knob/rev1_001/keyboard.json similarity index 100% rename from keyboards/ploopyco/dial/rev1_001/keyboard.json rename to keyboards/ploopyco/knob/rev1_001/keyboard.json diff --git a/keyboards/ploopyco/knob/rev1_001/readme.md b/keyboards/ploopyco/knob/rev1_001/readme.md new file mode 100644 index 00000000000..0c23bf73eda --- /dev/null +++ b/keyboards/ploopyco/knob/rev1_001/readme.md @@ -0,0 +1,3 @@ +This is the R1.001 version of the Knob. Future versions may have other features. + +See the [main readme](../readme.md) for more details. diff --git a/keyboards/ploopyco/ploopyco.c b/keyboards/ploopyco/ploopyco.c index a5365852504..9f8b83e2e7f 100644 --- a/keyboards/ploopyco/ploopyco.c +++ b/keyboards/ploopyco/ploopyco.c @@ -183,20 +183,18 @@ report_mouse_t pointing_device_task_kb(report_mouse_t mouse_report) { if (d_os == OS_WINDOWS || d_os == OS_LINUX) { // Establish a deadzone to prevent spurious inputs - // 4 was found to be a good number experimentally - if (delta > 4 || delta < -4) { + if (delta > POINTING_DEVICE_AS5600_DEADZONE || delta < -POINTING_DEVICE_AS5600_DEADZONE) { current_position = ra; - mouse_report.v = delta; + mouse_report.v = delta / POINTING_DEVICE_AS5600_SPEED_DIV; } } else { // Certain operating systems, like MacOS, don't play well with the // high-res scrolling implementation. For more details, see: // https://github.com/qmk/qmk_firmware/issues/17585#issuecomment-2325248167 - // 128 gives the scroll wheels "ticks". - if (delta >= 128) { + if (delta >= POINTING_DEVICE_AS5600_TICK_COUNT) { current_position = ra; mouse_report.v = 1; - } else if (delta <= -128) { + } else if (delta <= -POINTING_DEVICE_AS5600_TICK_COUNT) { current_position = ra; mouse_report.v = -1; }