diff --git a/led-badge-11x44.py b/led-badge-11x44.py index 5ccd944..10dcb16 100755 --- a/led-badge-11x44.py +++ b/led-badge-11x44.py @@ -364,7 +364,7 @@ proto_header = ( ) -def header(lengths, speeds, modes, blink, ants): +def header(lengths, speeds, modes, blink, ants, brightness=100): """ lengths[0] is the number of chars of the first text Speeds come in as 1..8, but are needed 0..7 here. @@ -382,6 +382,14 @@ def header(lengths, speeds, modes, blink, ants): m = m + [m[-1]]*(8-len(m)) # repeat last element h = list(proto_header) + + if brightness <= 25: + h[5] = 0x40 + elif brightness <= 50: + h[5] = 0x20 + elif brightness <= 75: + h[5] = 0x10 + for i in range(8): h[6] += b[i]<