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

@@ -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)