diff options
| author | Selene ToyKeeper | 2019-09-15 15:35:29 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2019-09-15 15:35:29 -0600 |
| commit | 5cde301fc1ae3f297804c93a2528ab4a79a5f6cd (patch) | |
| tree | 3592279f3c5c0ed99ff387db7a22187a4b01ae3c /bin/level_calc.py | |
| parent | fixed attiny13 builds (diff) | |
| download | anduril-5cde301fc1ae3f297804c93a2528ab4a79a5f6cd.tar.gz anduril-5cde301fc1ae3f297804c93a2528ab4a79a5f6cd.tar.bz2 anduril-5cde301fc1ae3f297804c93a2528ab4a79a5f6cd.zip | |
level_calc.py: note the highest level for each channel before the next channel starts,
so it'll be easier to identify the channel transition points
Diffstat (limited to '')
| -rwxr-xr-x | bin/level_calc.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bin/level_calc.py b/bin/level_calc.py index f16f8ce..f1e7d16 100755 --- a/bin/level_calc.py +++ b/bin/level_calc.py @@ -152,6 +152,16 @@ def multi_pwm(answers, channels): (cnum+1, ','.join([str(int(round(i))) for i in channel.modes]))) + # Show highest level for each channel before next channel starts + for cnum, channel in enumerate(channels[:-1]): + prev = 0 + i = 1 + while (i < answers.num_levels) \ + and (channel.modes[i] >= channel.modes[i-1]) \ + and (channels[cnum+1].modes[i] == 0): + i += 1 + print('Ch%i max: %i (%.2f/255)' % (cnum, i, channel.modes[i-1])) + def get_value(text, default, args): """Get input from the user, or from the command line args.""" |
