Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand v4 led0 range to 0..255 #69

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sneakers-the-rat
Copy link
Contributor

@sneakers-the-rat sneakers-the-rat commented Feb 2, 2024

Related to:

Problem

Some lucky people have such lovely bright and clear signal that they need to make the illumination LED as dim as possible.

The current led0 configuration maps 0..100 -> 0..255, which naturally reduces the number of possible brightness states from 256 to 101, the relevant line in the software is here:

onValueChanged: root.valueChangedSignal(value, (value * root.displayValueScale - root.displayValueOffset)<<root.displayValueBitShift, 0)

So for the current settings:

  • displayValueScale: -2.55
  • displayValueOffset: -255

the value map created is:

Expand/collapse value map
input output
0 255
1 252
2 250
3 247
4 245
5 242
6 240
7 237
8 235
9 232
10 230
11 227
12 224
13 222
14 219
15 217
16 214
17 212
18 209
19 207
20 204
21 201
22 199
23 196
24 194
25 191
26 189
27 186
28 184
29 181
30 178
31 176
32 173
33 171
34 168
35 166
36 163
37 161
38 158
39 156
40 153
41 150
42 148
43 145
44 143
45 140
46 138
47 135
48 133
49 130
50 128
51 125
52 122
53 120
54 117
55 115
56 112
57 110
58 107
59 105
60 102
61 99
62 97
63 94
64 92
65 89
66 87
67 84
68 82
69 79
70 76
71 74
72 71
73 69
74 66
75 64
76 61
77 59
78 56
79 54
80 51
81 48
82 46
83 43
84 41
85 38
86 36
87 33
88 31
89 28
90 26
91 23
92 20
93 18
94 15
95 13
96 10
97 8
98 5
99 3
100 0

Fix

That seems to only really be a problem on the low end, where someone could access 2/3 and 1/3 of the current minimum brightness.

The reason for wanting to constrain from 0..100 is to make proportions sensible - 100% brightness is more intuitive than the max being 255, but it seems like at the point that it's limiting functionality it might be worth expanding to the full range.

This PR is just one way of doing this without needing to recompile anything. It changes the range to 0..255, the scale to 1, and the offset to 255 for a map of (x*1)-255

Other options

  • make another directory examples with a README.md document in it, where we make this modified deviceConfig file an example with the full LED range and explain what it does in the README
  • make the StepSize smaller, like 0.1 or something - this would keep the 0..100 range while allowing someone to access the full 0..255 output range, but imo it's somewhat undesirable because a lot of changes to float values would actually not change the output value at all, which would lead to bad intuition traps trying to micro-adjust values that aren't actually doing anything.
  • make another v4 device config something like v4_full_led0_range - but that seems undesirable because we get into combinatorics of "for every variant we square the number of devices we have"
  • ideally this would be something one could toggle in the UI, but that's about a thousand times more work than changing 4 lines in the config for now ;)

Anyway what do ya think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant