MCPcopy Index your code
hub / github.com/FrameworkComputer/inputmodule-rs / breathing

Function breathing

python/inputmodule/inputmodule/ledmatrix.py:294–317  ·  view source on GitHub ↗

Animate breathing brightness. Keeps currently displayed grid

(dev)

Source from the content-addressed store, hash-verified

292
293
294def breathing(dev):
295 """Animate breathing brightness.
296 Keeps currently displayed grid"""
297 # Bright ranges appear similar, so we have to go through those faster
298 while True:
299 # Go quickly from 250 to 50
300 for i in range(10):
301 time.sleep(0.03)
302 brightness(dev, 250 - i * 20)
303
304 # Go slowly from 50 to 0
305 for i in range(10):
306 time.sleep(0.06)
307 brightness(dev, 50 - i * 5)
308
309 # Go slowly from 0 to 50
310 for i in range(10):
311 time.sleep(0.06)
312 brightness(dev, i * 5)
313
314 # Go quickly from 50 to 250
315 for i in range(10):
316 time.sleep(0.03)
317 brightness(dev, 50 + i * 20)
318
319
320def eq(dev, vals):

Callers 2

main_cliFunction · 0.90
countdownFunction · 0.90

Calls 1

brightnessFunction · 0.90

Tested by

no test coverage detected