我有100个地址LED:已连接对一个RPi,想让他们随机眨眼。在
我最初的想法是在启动时创建一个包含100个数字的随机列表,然后循环一个接一个地打开它们。过了一段时间后,我想再次关闭它们。在
RGBlist = [100 random numbers 0-99]
for i in RGBlist:
turnOnLED(i)
如何启动第二个循环与第一个循环同时运行?在
^{pr2}$我不希望所有的100个LED在一次关闭之前都打开,我希望LED(x)打开,然后LED(y),LED(z),LED(x)关闭,LED(u)打开,LED(y)关闭,等等。如果它们在被点亮100-500毫秒后可以关闭,那就更好了
我需要进入多处理和线程的深渊吗?在
我想你不用多线程了。你可以先制定一个行动计划,然后再执行它。例如:
相关问题 更多 >
编程相关推荐