build(boards): xpython板卡执行 npm run build:prod
This commit is contained in:
@@ -59,14 +59,12 @@ except Exception as e:
|
||||
print("Warning: Failed to communicate with MMC5603 (MGS) or", e)
|
||||
|
||||
'''TFT/240*240'''
|
||||
onboard_tft = st7789_bf.ST7789(onboard_spi, 240, 240, dc_pin=46, cs_pin=45, bl_pin=onboard_bot.tft_brightness, brightness=0, font_address=0x700000)
|
||||
onboard_tft = st7789_bf.ST7789(onboard_spi, 240, 240, dc_pin=46, cs_pin=45, bl_pin=onboard_bot.tft_brightness, brightness=0.6, font_address=0x700000)
|
||||
|
||||
'''2RGB_WS2812'''
|
||||
onboard_rgb = NeoPixel(Pin(40), 4)
|
||||
|
||||
'''5KEY_Sensor'''
|
||||
|
||||
|
||||
class KEYSensor:
|
||||
def __init__(self, pin, range):
|
||||
self.pin = pin
|
||||
@@ -103,10 +101,7 @@ class KEYSensor:
|
||||
def irq(self, handler, trigger):
|
||||
Pin(self.pin, Pin.IN).irq(handler=handler, trigger=trigger)
|
||||
|
||||
|
||||
'''1KEY_Button'''
|
||||
|
||||
|
||||
class Button(KEYSensor):
|
||||
def __init__(self, pin):
|
||||
self.pin = pin
|
||||
@@ -116,7 +111,6 @@ class Button(KEYSensor):
|
||||
def _value(self):
|
||||
return not self.key.value()
|
||||
|
||||
|
||||
B1key = Button(0)
|
||||
B2key = KEYSensor(17, 0)
|
||||
A1key = KEYSensor(17, 2300)
|
||||
@@ -125,8 +119,6 @@ A3key = KEYSensor(17, 800)
|
||||
A4key = KEYSensor(17, 2900)
|
||||
|
||||
'''2LED-Independent'''
|
||||
|
||||
|
||||
class LED:
|
||||
def __init__(self, pins=[]):
|
||||
self._pins = [PWM(Pin(pin), duty_u16=0) for pin in pins]
|
||||
@@ -153,10 +145,8 @@ class LED:
|
||||
def getonoff(self, index):
|
||||
return True if self.getbrightness(index) > 50 else False
|
||||
|
||||
|
||||
onboard_led = LED([38, 39])
|
||||
|
||||
|
||||
class Clock:
|
||||
def __init__(self, x, y, radius, color, oled=onboard_tft): # 定义时钟中心点和半径
|
||||
self.display = oled
|
||||
@@ -227,7 +217,5 @@ class Clock:
|
||||
def clear(self, color=0): # 清除
|
||||
self.display.ellipse(self.xc, self.yc, self.r, self.r, color, True)
|
||||
|
||||
|
||||
'''Reclaim memory'''
|
||||
gc.collect()
|
||||
onboard_tft.set_brightness(0.6)
|
||||
|
||||
Reference in New Issue
Block a user