You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `calculate_window` parameter determines how many adjacent touch channels are used for position calculation. This affects the precision and noise immunity of the slider.
24
+
25
+
**Default Values (when set to 0):**
26
+
-**2 channels**: `calculate_window = 2` (uses all available channels)
27
+
-**3+ channels**: `calculate_window = 3` (optimal balance between precision and noise immunity)
28
+
29
+
**Manual Configuration:**
30
+
- You can explicitly set any value from 1 to `channel_num`
31
+
- Smaller values (1-2): Higher sensitivity but more susceptible to noise
Copy file name to clipboardExpand all lines: components/touch/touch_slider_sensor/include/touch_slider_sensor.h
+11-2Lines changed: 11 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,8 @@ typedef struct {
29
29
uint32_t*channel_gold_value; /*!< (Optional) Reference values for touch channels */
30
30
uint32_tdebounce_times; /*!< Number of consecutive readings needed to confirm state change */
31
31
uint32_tfilter_reset_times; /*!< Number of consecutive readings to reset position filter */
32
-
uint32_tposition_range; /*!< The right region of touch slider position range, [0, position_range (less than or equal to 255)] */
32
+
uint32_tposition_range; /*!< Maximum position value of touch slider, range [0, position_range]. Higher values provide better position resolution */
33
+
uint8_tcalculate_window; /*!< Window size for position calculation (should be <= channel_num). Set to 0 for auto-default: 2 for 2-channel, 3 for 3+ channels */
33
34
floatswipe_threshold; /*!< The speed threshold for identifying swiping */
34
35
floatswipe_hysterisis; /*!< The speed hysterisis for identifying swiping */
35
36
floatswipe_alpha; /*!< Filter parameter for estimating speed */
0 commit comments