我正在尝试运行动画一段时间,然后清除 LED 并返回手动设置颜色Neopixel.pixels.fill()。只是,在我运行之后animation.animate(),我失去了使用pixels.fill()我尝试使用带有auto_clear和auto_reset标志的序列库的能力,但这些似乎也不起作用。
rainbow = Rainbow(macropad.pixels, speed = 0.005, period = 2)
animations = AnimationSequence(rainbow, auto_clear=True, auto_reset=True)
i = 0
while True:
animations.animate()
i += 1
if (i == 100):
animations.reset()
break