File tree 1 file changed +18
-3
lines changed
1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -62,9 +62,24 @@ If you have a large value range (you can set the range with the `min_val` and
62
62
can be very cumbersome. You can enable acceleration by passing a positive
63
63
integer to the ` accel ` keyword argument. The proper value depends on value
64
64
range and the type of the encoder, but usually low one-digit numbers like 3-5
65
- work well. With acceleration enabled the increment/decrement per click increases
66
- the faster your turn the encoder. You can still make fine adjustment by turning
67
- the encoder slowly.
65
+ work well. With acceleration enabled the increment/decrement per click
66
+ increases the faster your turn the encoder. You can still make fine adjustment
67
+ by turning the encoder slowly.
68
+
69
+ Currently, if you use the acceleration feature, you need to take care of
70
+ decreasing the the current acceleration, which increases everytime a valid
71
+ pulse is read from the encoder. Normally you would do this at the end of your
72
+ main loop, i.e. once per poll interval:
73
+
74
+ oldval = 0
75
+ while True:
76
+ val = enc.value
77
+ if oldval != val:
78
+ print(val)
79
+ oldval = val
80
+
81
+ enc.cur_accel = max(0, enc.cur_accel - enc.accel)
82
+ sleep_ms(50)
68
83
69
84
70
85
TODO
You can’t perform that action at this time.
0 commit comments