make blinkenlights more responsive
This commit is contained in:
parent
c7814c39a7
commit
0923eef297
|
@ -26,10 +26,9 @@ class Blinkenlights(ExceptionThread):
|
||||||
pwm.start(0)
|
pwm.start(0)
|
||||||
while not self._stopper.isSet():
|
while not self._stopper.isSet():
|
||||||
if self._blink.is_set():
|
if self._blink.is_set():
|
||||||
t = self._sleeptime
|
|
||||||
for dc in chain(range(100, -1, -5), range(0, 101, 5)):
|
for dc in chain(range(100, -1, -5), range(0, 101, 5)):
|
||||||
pwm.ChangeDutyCycle(dc)
|
pwm.ChangeDutyCycle(dc)
|
||||||
time.sleep(t)
|
time.sleep(self._sleeptime)
|
||||||
else:
|
else:
|
||||||
pwm.ChangeDutyCycle(100)
|
pwm.ChangeDutyCycle(100)
|
||||||
self._blink.wait()
|
self._blink.wait()
|
||||||
|
|
Loading…
Reference in New Issue