【发布时间】:2021-05-01 14:38:29
【问题描述】:
我正试图让 LED 像秒针一样前进。
np = neopixel.NeoPixel(machine.Pin(2), led)
while True:
t = utime.localtime()
h = int(utime.localtime()[3]) + time_zone
m = utime.localtime()[4]
s = utime.localtime()[5]
np[h] = (64, 64, 64)
np[m] = (64, 64, 64)
np[s] = (64, 64, 64)#turn on
time.sleep(1)
sc = s - 1
np[sc] = (0, 0, 0)#turn off
np.write()
但我认为我的代码不是一个好主意。
【问题讨论】:
-
你有什么样的新像素?运行代码时会发生什么?另外,
led的值是多少? -
WS2812。 60条灯带。当我添加分针时,秒针经过时会关闭分针。
标签: python esp8266 micropython neopixel