更新 mini固件,RGB 支持老版本21812,LED灯颜色立即生效
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -228,6 +228,7 @@ class BOT035(FrameBuffer):
|
||||
"""Reset SPK, PWM, HID registers to default state"""
|
||||
self._i2c.writeto_mem(_BOT035_ADDRESS, _BOT035_SPK, b'\x0A\x00\x00\x00\x20\x4E\x64\x64')
|
||||
if self._version: self._i2c.writeto_mem(_BOT035_ADDRESS, _BOT035_KB, bytes(9))
|
||||
|
||||
def get_brightness(self):
|
||||
return self._brightness
|
||||
|
||||
|
||||
@@ -164,6 +164,7 @@ class LED:
|
||||
|
||||
def setcolor(self, index, color):
|
||||
self._col[index-1] = color
|
||||
self.setbrightness(index, 100)
|
||||
|
||||
def getcolor(self, index):
|
||||
return self._col[index-1]
|
||||
|
||||
@@ -37,9 +37,8 @@ class NeoPixel:
|
||||
|
||||
def write(self):
|
||||
self.pin.init(self.pin.OUT, value=0)
|
||||
sleep_us(40)
|
||||
bitstream(self.pin, 0, self.timing, bytes(3) + self.rgb_buf)
|
||||
sleep_us(40)
|
||||
sleep_us(150)
|
||||
self.pin.init(self.pin.IN)
|
||||
|
||||
def color_chase(self,R, G, B, wait):
|
||||
|
||||
Reference in New Issue
Block a user