标签:col rgb sleep color pix pre range class mic
robotbit扩展板4个rgb灯,r-红,g-绿,b-蓝,值为0~255,可模拟出256*256*256种颜色。
from microbit import * import neopixel r = 0 g = 0 b = 0 np = neopixel.NeoPixel(pin16, 4) for r in range(0,256,10): for g in range(0,256,10): for b in range(0,256,10): np[0] = (r, g, b) sleep(200) np.show()
标签:col rgb sleep color pix pre range class mic
原文地址:https://www.cnblogs.com/qywyll/p/11896801.html