aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorSelene ToyKeeper2019-07-30 15:57:53 -0600
committerSelene ToyKeeper2019-07-30 15:57:53 -0600
commit2d6f377109f2dff13c0261f518c68dd6f416227d (patch)
tree04fb912bc605abd34e743dd7512c29691302d6c2 /bin
parentmerged a sanitized copy of the Emisar D4v2 branch; history summarized below: (diff)
downloadanduril-2d6f377109f2dff13c0261f518c68dd6f416227d.tar.gz
anduril-2d6f377109f2dff13c0261f518c68dd6f416227d.tar.bz2
anduril-2d6f377109f2dff13c0261f518c68dd6f416227d.zip
level_calc: made it easier to change maximum PWM value
(will need a max of 1023 soon instead of 255)
Diffstat (limited to '')
-rwxr-xr-xbin/level_calc.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/bin/level_calc.py b/bin/level_calc.py
index f1e7d16..59b75ee 100755
--- a/bin/level_calc.py
+++ b/bin/level_calc.py
@@ -8,6 +8,8 @@ interactive = False
# supported shapes: ninth, seventh, fifth, cube, square, log
#ramp_shape = 'cube'
+max_pwm = 255
+
def main(args):
"""Calculates PWM levels for visually-linear steps.
@@ -22,7 +24,7 @@ def main(args):
(str, 'type', '7135', 'Type of channel - 7135 or FET:'),
(int, 'pwm_min', 6, 'Lowest visible PWM level:'),
(float, 'lm_min', 0.25, 'How bright is the lowest level, in lumens?'),
- #(int, 'pwm_max', 255, 'Highest PWM level:'),
+ #(int, 'pwm_max', max_pwm, 'Highest PWM level:'),
(float, 'lm_max', 1000, 'How bright is the highest level, in lumens?'),
]
@@ -48,7 +50,7 @@ def main(args):
if not args:
print('===== Channel %s =====' % (chan_num+1))
chan = Empty()
- chan.pwm_max = 255
+ chan.pwm_max = max_pwm
ask(questions_per_channel, chan)
chan.type = chan.type.upper()
if chan.type not in ('7135', 'FET'):
@@ -160,7 +162,7 @@ def multi_pwm(answers, channels):
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]))
+ print('Ch%i max: %i (%.2f/%s)' % (cnum, i, channel.modes[i-1], max_pwm))
def get_value(text, default, args):