Update(boards): micropython板卡执行 build:prod

This commit is contained in:
王立帮
2024-09-16 02:57:45 +08:00
parent b573250af6
commit 688fefc6ba
29 changed files with 38 additions and 40 deletions

View File

@@ -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
@@ -319,14 +320,14 @@ class BOT035(FrameBuffer):
print("Warning: Please upgrade the coprocessor firmware to use this feature")
"""Graph module"""
HEART=b'\x00\x0c\x1e?~\xfc~?\x1e\x0c\x00\x00'
HEART_SMALL=b'\x00\x00\x0c\x1e<x<\x1e\x0c\x00\x00\x00'
HAPPY=b'\x00\x06\x06\x10 @@ \x10\x06\x06\x00'
SAD=b'\x04\x02\x02B \x10\x10 B\x02\x02\x04'
SMILE=b'\x04\x02\x02$@\x80\x80@$\x02\x02\x04'
ANGRY=b'\x01\x02\x84B!\x10\x10!B\x84\x02\x01'
NO=b'\x00\x00\x00B$\x18\x18$B\x00\x00\x00'
YES=b'\x00\x00\x10 @@ \x10\x08\x04\x02\x00'
DOOR_OPEN=b'\x00\x00\xfe\x03\x03\x03\x13\x13\xff\xfe\x00\x00'
DOOR_OPENING=b'\x00\x00\xfe\x03\x03\x15\xf9\x01\x01\xfe\x00\x00'
DOOR_CLOSE=b'\x00\x00\xfe\xfd\x01\x01\x01\x01\x01\xfe\x00\x00'
HEART =b'\x00\x0c\x1e?~\xfc~?\x1e\x0c\x00\x00'
HEART_SMALL =b'\x00\x00\x0c\x1e<x<\x1e\x0c\x00\x00\x00'
HAPPY =b'\x00\x06\x06\x10 @@ \x10\x06\x06\x00'
SAD =b'\x04\x02\x02B \x10\x10 B\x02\x02\x04'
SMILE =b'\x04\x02\x02$@\x80\x80@$\x02\x02\x04'
ANGRY =b'\x01\x02\x84B!\x10\x10!B\x84\x02\x01'
NO =b'\x00\x00\x00B$\x18\x18$B\x00\x00\x00'
YES =b'\x00\x00\x10 @@ \x10\x08\x04\x02\x00'
DOOR_OPEN =b'\x00\x00\xfe\xfd\x01\x01\x01\x01\x01\xfe\x00\x00'
DOOR_OPENING =b'\x00\x00\xfe\x03\x03\x15\xf9\x01\x01\xfe\x00\x00'
DOOR_CLOSE =b'\x00\x00\xfe\x03\x03\x03\x13\x13\xff\xfe\x00\x00'

View File

@@ -125,15 +125,15 @@ class Button(KEYSensor):
return not self.key.value()
B1key = Button(9)
B2key = KEYSensor(0,0)
A1key = KEYSensor(0,2100)
A2key = KEYSensor(0,1500)
A3key = KEYSensor(0,800)
A4key = KEYSensor(0,2700)
B2key = KEYSensor(0, 0)
A1key = KEYSensor(0, 2100)
A2key = KEYSensor(0, 1500)
A3key = KEYSensor(0, 800)
A4key = KEYSensor(0, 2700)
'''2LED-Multiplex RGB'''
class LED:
def __init__(self, rgb, num=2, color=3):
def __init__(self, rgb, num=2, color=7):
self._rgb = rgb
self._col = [color] * num
self._color = ((0, 0, 0), (1, 0, 0), (0, 1, 0), (0, 0, 1), (1, 1, 0), (0, 1, 1), (1, 0, 1), (1, 1, 1))
@@ -160,13 +160,11 @@ class LED:
self.setbrightness(index, 0)
def getonoff(self, index):
return True if self.getbrightness(index) > 50 else False
return True if self.getbrightness(index) >= 50 else False
def setcolor(self, index, color):
def setcolor(self, index, color, value=50):
self._col[index-1] = color
def getcolor(self, index):
return self._col[index-1]
self.setbrightness(index, value)
onboard_led = LED(onboard_rgb)

View File

@@ -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)
bitstream(self.pin, 0, self.timing, bytes(3) + self.rgb_buf)
sleep_us(150)
self.pin.init(self.pin.IN)
def color_chase(self,R, G, B, wait):

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long