build(boards): 所有板卡执行 npm run build:prod
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
77
boards/default/micropython_esp32c3/build/lib/map.json
Normal file
77
boards/default/micropython_esp32c3/build/lib/map.json
Normal file
@@ -0,0 +1,77 @@
|
||||
{
|
||||
"me_g1": {
|
||||
"__require__": [
|
||||
"time",
|
||||
"gc",
|
||||
"machine",
|
||||
"hp203x",
|
||||
"ahtx0",
|
||||
"rc522"
|
||||
],
|
||||
"__file__": true,
|
||||
"__size__": 1327,
|
||||
"__name__": "me_g1.py"
|
||||
},
|
||||
"me_go": {
|
||||
"__require__": [
|
||||
"time",
|
||||
"gc",
|
||||
"math",
|
||||
"tm1931",
|
||||
"machine"
|
||||
],
|
||||
"__file__": true,
|
||||
"__size__": 8787,
|
||||
"__name__": "me_go.py"
|
||||
},
|
||||
"mixgocar_c3": {
|
||||
"__require__": [
|
||||
"time",
|
||||
"gc",
|
||||
"ms32006",
|
||||
"machine",
|
||||
"ws2812",
|
||||
"music"
|
||||
],
|
||||
"__file__": true,
|
||||
"__size__": 9735,
|
||||
"__name__": "mixgocar_c3.py"
|
||||
},
|
||||
"mixgo_cc": {
|
||||
"__require__": [
|
||||
"time",
|
||||
"gc",
|
||||
"machine",
|
||||
"ws2812",
|
||||
"music",
|
||||
"mxc6655xa",
|
||||
"ltr553als",
|
||||
"rc522",
|
||||
"matrix32x12",
|
||||
"mmc5603",
|
||||
"hp203x",
|
||||
"spl06_001",
|
||||
"ahtx0",
|
||||
"shtc3"
|
||||
],
|
||||
"__file__": true,
|
||||
"__size__": 6824,
|
||||
"__name__": "mixgo_cc.py"
|
||||
},
|
||||
"mixgo_me": {
|
||||
"__require__": [
|
||||
"time",
|
||||
"gc",
|
||||
"machine",
|
||||
"ws2812",
|
||||
"music",
|
||||
"mxc6655xa",
|
||||
"ltr553als",
|
||||
"matrix8x5",
|
||||
"mmc5603"
|
||||
],
|
||||
"__file__": true,
|
||||
"__size__": 4790,
|
||||
"__name__": "mixgo_me.py"
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,12 @@
|
||||
"""
|
||||
MixGo CC -Onboard resources
|
||||
MixGo CC Onboard resources
|
||||
|
||||
MicroPython library for the MixGo CC -Onboard resources
|
||||
MicroPython library for the MixGo CC Onboard resources
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20221010
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
@dahanzimin From the Mixly Team
|
||||
"""
|
||||
import time, gc
|
||||
from machine import Pin, SoftI2C, ADC, PWM, RTC
|
||||
from machine import *
|
||||
|
||||
'''i2c-onboard'''
|
||||
onboard_i2c=SoftI2C(scl = Pin(7), sda = Pin(6), freq = 400000)
|
||||
@@ -95,7 +92,7 @@ onboard_rgb = NeoPixel(Pin(8), 4, ORDER=(0, 1, 2, 3))
|
||||
|
||||
'''1Buzzer-Music'''
|
||||
from music import MIDI
|
||||
onboard_music =MIDI(10)
|
||||
onboard_music = MIDI(10)
|
||||
|
||||
'''MIC_Sensor'''
|
||||
class MICSensor:
|
||||
@@ -105,10 +102,10 @@ class MICSensor:
|
||||
def read(self):
|
||||
maxloudness = 0
|
||||
for i in range(5):
|
||||
loudness = self.sample()
|
||||
loudness = self.sample()
|
||||
if loudness > maxloudness:
|
||||
maxloudness = loudness
|
||||
return maxloudness
|
||||
return maxloudness
|
||||
|
||||
def sample(self):
|
||||
values = []
|
||||
@@ -119,21 +116,24 @@ class MICSensor:
|
||||
|
||||
onboard_sound = MICSensor(pin=4 if version else 3)
|
||||
|
||||
'''4,5KEY_Sensor'''
|
||||
'''5KEY_Sensor'''
|
||||
class KEYSensor:
|
||||
def __init__(self, pin, range):
|
||||
self.adc = ADC(Pin(pin), atten=ADC.ATTN_11DB)
|
||||
self.pin = pin
|
||||
self.adc = ADC(Pin(pin), atten=ADC.ATTN_11DB)
|
||||
self.range = range
|
||||
self.flag = True
|
||||
|
||||
|
||||
def _value(self):
|
||||
values = []
|
||||
for _ in range(50):
|
||||
values.append(self.adc.read())
|
||||
time.sleep_us(2)
|
||||
return (self.range - 300) < min(sorted(values)[25:]) < (self.range + 300)
|
||||
|
||||
for _ in range(25):
|
||||
try:
|
||||
values.append(self.adc.read())
|
||||
except: #IDF>5.2.2存在ADC2问题
|
||||
pass
|
||||
time.sleep_us(5)
|
||||
return (self.range-200) < min(values) < (self.range+200)
|
||||
|
||||
def get_presses(self, delay = 1):
|
||||
last_time,presses = time.time(), 0
|
||||
while time.time() < last_time + delay:
|
||||
@@ -148,7 +148,7 @@ class KEYSensor:
|
||||
def was_pressed(self):
|
||||
if(self._value() != self.flag):
|
||||
self.flag = self._value()
|
||||
if self.flag :
|
||||
if self.flag:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
@@ -156,34 +156,15 @@ class KEYSensor:
|
||||
def irq(self, handler, trigger):
|
||||
Pin(self.pin, Pin.IN).irq(handler = handler, trigger = trigger)
|
||||
|
||||
'''2,1KEY_Button'''
|
||||
class Button:
|
||||
'''1KEY_Button'''
|
||||
class Button(KEYSensor):
|
||||
def __init__(self, pin):
|
||||
self.pin = Pin(pin, Pin.IN)
|
||||
self.pin = pin
|
||||
self.key = Pin(pin, Pin.IN)
|
||||
self.flag = True
|
||||
|
||||
def get_presses(self, delay = 1):
|
||||
last_time,presses = time.time(), 0
|
||||
while time.time() < last_time + delay:
|
||||
time.sleep(0.05)
|
||||
if self.was_pressed():
|
||||
presses += 1
|
||||
return presses
|
||||
|
||||
def is_pressed(self):
|
||||
return not self.pin.value()
|
||||
|
||||
def was_pressed(self, flag = 0):
|
||||
if(self.pin.value() != self.flag):
|
||||
self.flag = self.pin.value()
|
||||
time.sleep(0.02)
|
||||
if self.flag:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
def irq(self, handler, trigger):
|
||||
self.pin.irq(handler = handler, trigger = trigger)
|
||||
def _value(self):
|
||||
return not self.key.value()
|
||||
|
||||
if version==0:
|
||||
B1key = Button(9)
|
||||
@@ -191,7 +172,7 @@ if version==0:
|
||||
A1key = KEYSensor(2,20)
|
||||
A2key = KEYSensor(2,1170)
|
||||
A3key = KEYSensor(2,2400)
|
||||
A4key = KEYSensor(2,3610)
|
||||
A4key = KEYSensor(2,3610)
|
||||
|
||||
else:
|
||||
B1key = Button(9)
|
||||
@@ -201,7 +182,7 @@ else:
|
||||
A3key = KEYSensor(5,2500)
|
||||
A4key = KEYSensor(5,3500)
|
||||
|
||||
'''2-LED''' #Modify indexing method
|
||||
'''2-LED''' #Modify indexing method
|
||||
class LED:
|
||||
def __init__(self, pins=[]):
|
||||
self._pins = pins
|
||||
@@ -231,11 +212,11 @@ class LED:
|
||||
print("Warning: Old version, without this function")
|
||||
else:
|
||||
if val == -1:
|
||||
self.setbrightness(index, 100) if self.getbrightness(index) < 50 else self.setbrightness(index, 0)
|
||||
self.setbrightness(index, 100) if self.getbrightness(index) < 50 else self.setbrightness(index, 0)
|
||||
elif val == 1:
|
||||
self.setbrightness(index, 100)
|
||||
self.setbrightness(index, 100)
|
||||
elif val == 0:
|
||||
self.setbrightness(index, 0)
|
||||
self.setbrightness(index, 0)
|
||||
|
||||
def getonoff(self, index):
|
||||
if len(self._pins) == 0:
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
"""
|
||||
MixGo ME -Onboard resources
|
||||
MixGo ME Onboard resources
|
||||
|
||||
MicroPython library for the MixGo ME -Onboard resources
|
||||
MicroPython library for the MixGo ME Onboard resources
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20221010
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
@dahanzimin From the Mixly Team
|
||||
"""
|
||||
|
||||
import time, gc
|
||||
from machine import Pin, SoftI2C, ADC, PWM, RTC
|
||||
from machine import *
|
||||
|
||||
'''i2c-onboard'''
|
||||
onboard_i2c=SoftI2C(scl = Pin(7), sda = Pin(6), freq = 400000)
|
||||
@@ -52,7 +48,7 @@ onboard_rgb = NeoPixel(Pin(9), 2, ORDER=(0, 1, 2, 3), multiplex=1)
|
||||
|
||||
'''1Buzzer-Music'''
|
||||
from music import MIDI
|
||||
onboard_music =MIDI(10)
|
||||
onboard_music = MIDI(10)
|
||||
|
||||
'''MIC_Sensor'''
|
||||
class MICSensor:
|
||||
@@ -62,7 +58,7 @@ class MICSensor:
|
||||
def read(self):
|
||||
maxloudness = 0
|
||||
for i in range(5):
|
||||
loudness = self.sample()
|
||||
loudness = self.sample()
|
||||
if loudness > maxloudness:
|
||||
maxloudness = loudness
|
||||
return maxloudness
|
||||
@@ -78,18 +74,22 @@ onboard_sound = MICSensor()
|
||||
|
||||
'''5KEY_Sensor'''
|
||||
class KEYSensor:
|
||||
def __init__(self,range):
|
||||
self.adc=ADC(Pin(5), atten=ADC.ATTN_11DB)
|
||||
self.range=range
|
||||
def __init__(self, pin, range):
|
||||
self.pin = pin
|
||||
self.adc = ADC(Pin(pin), atten=ADC.ATTN_11DB)
|
||||
self.range = range
|
||||
self.flag = True
|
||||
|
||||
|
||||
def _value(self):
|
||||
values = []
|
||||
for _ in range(50):
|
||||
values.append(self.adc.read())
|
||||
time.sleep_us(2)
|
||||
return (self.range - 300) < min(sorted(values)[25:]) < (self.range + 300)
|
||||
|
||||
for _ in range(25):
|
||||
try:
|
||||
values.append(self.adc.read())
|
||||
except: #IDF>5.2.2存在ADC2问题
|
||||
pass
|
||||
time.sleep_us(5)
|
||||
return (self.range-200) < min(values) < (self.range+200)
|
||||
|
||||
def get_presses(self, delay = 1):
|
||||
last_time,presses = time.time(), 0
|
||||
while time.time() < last_time + delay:
|
||||
@@ -97,57 +97,37 @@ class KEYSensor:
|
||||
if self.was_pressed():
|
||||
presses += 1
|
||||
return presses
|
||||
|
||||
|
||||
def is_pressed(self):
|
||||
return self._value()
|
||||
|
||||
def was_pressed(self):
|
||||
if(self._value() != self.flag):
|
||||
self.flag = self._value()
|
||||
if self.flag :
|
||||
if self.flag:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def irq(self, handler, trigger):
|
||||
Pin(5, Pin.IN).irq(handler = handler, trigger = trigger)
|
||||
|
||||
B2key = KEYSensor(20)
|
||||
A1key = KEYSensor(800)
|
||||
A2key = KEYSensor(1600)
|
||||
A3key = KEYSensor(2500)
|
||||
A4key = KEYSensor(3500)
|
||||
Pin(self.pin, Pin.IN).irq(handler = handler, trigger = trigger)
|
||||
|
||||
'''1KEY_Button'''
|
||||
class Button:
|
||||
class Button(KEYSensor):
|
||||
def __init__(self, pin):
|
||||
self.pin = Pin(pin, Pin.IN)
|
||||
self.pin = pin
|
||||
self.key = Pin(pin, Pin.IN)
|
||||
self.flag = True
|
||||
|
||||
def get_presses(self, delay = 1):
|
||||
last_time,presses = time.time(), 0
|
||||
while time.time() < last_time + delay:
|
||||
time.sleep(0.05)
|
||||
if self.was_pressed():
|
||||
presses += 1
|
||||
return presses
|
||||
|
||||
def is_pressed(self):
|
||||
return not self.pin.value()
|
||||
def _value(self):
|
||||
return not self.key.value()
|
||||
|
||||
def was_pressed(self, flag = 0):
|
||||
if(self.pin.value() != self.flag):
|
||||
self.flag = self.pin.value()
|
||||
time.sleep(0.02)
|
||||
if self.flag:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
def irq(self, handler, trigger):
|
||||
self.pin.irq(handler = handler, trigger = trigger)
|
||||
|
||||
B1key = Button(9)
|
||||
B2key = KEYSensor(5,20)
|
||||
A1key = KEYSensor(5,800)
|
||||
A2key = KEYSensor(5,1600)
|
||||
A3key = KEYSensor(5,2500)
|
||||
A4key = KEYSensor(5,3500)
|
||||
|
||||
'''2LED-Multiplex RGB'''
|
||||
class LED:
|
||||
|
||||
@@ -3,13 +3,10 @@ MixGo CAR -Onboard resources
|
||||
|
||||
MicroPython library for the MixGo CAR (ESP32C3)
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20220804
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
@dahanzimin From the Mixly Team
|
||||
"""
|
||||
import time,gc,ms32006
|
||||
from machine import Pin,SoftI2C,ADC,RTC
|
||||
from machine import *
|
||||
|
||||
'''RTC'''
|
||||
rtc_clock=RTC()
|
||||
@@ -17,7 +14,7 @@ rtc_clock=RTC()
|
||||
'''i2c-onboard'''
|
||||
onboard_i2c=SoftI2C(scl = Pin(7), sda = Pin(6), freq = 400000)
|
||||
|
||||
'''4RGB_WS2812''' #color_chase(),rainbow_cycle()方法移至类里
|
||||
'''4RGB_WS2812'''
|
||||
from ws2812 import NeoPixel
|
||||
onboard_rgb = NeoPixel(Pin(8), 4, ORDER=(0, 1, 2, 3))
|
||||
|
||||
|
||||
@@ -9,20 +9,20 @@
|
||||
"messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
|
||||
"options": [
|
||||
{
|
||||
"key": "460800",
|
||||
"label": "460800"
|
||||
"key": "921600",
|
||||
"label": "921600"
|
||||
},
|
||||
{
|
||||
"key": "115200",
|
||||
"label": "115200"
|
||||
"key": "460800",
|
||||
"label": "460800"
|
||||
},
|
||||
{
|
||||
"key": "230400",
|
||||
"label": "230400"
|
||||
},
|
||||
{
|
||||
"key": "921600",
|
||||
"label": "921600"
|
||||
"key": "115200",
|
||||
"label": "115200"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -37,20 +37,20 @@
|
||||
"messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
|
||||
"options": [
|
||||
{
|
||||
"key": "460800",
|
||||
"label": "460800"
|
||||
"key": "921600",
|
||||
"label": "921600"
|
||||
},
|
||||
{
|
||||
"key": "115200",
|
||||
"label": "115200"
|
||||
"key": "460800",
|
||||
"label": "460800"
|
||||
},
|
||||
{
|
||||
"key": "230400",
|
||||
"label": "230400"
|
||||
},
|
||||
{
|
||||
"key": "921600",
|
||||
"label": "921600"
|
||||
"key": "115200",
|
||||
"label": "115200"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -65,20 +65,20 @@
|
||||
"messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
|
||||
"options": [
|
||||
{
|
||||
"key": "460800",
|
||||
"label": "460800"
|
||||
"key": "921600",
|
||||
"label": "921600"
|
||||
},
|
||||
{
|
||||
"key": "115200",
|
||||
"label": "115200"
|
||||
"key": "460800",
|
||||
"label": "460800"
|
||||
},
|
||||
{
|
||||
"key": "230400",
|
||||
"label": "230400"
|
||||
},
|
||||
{
|
||||
"key": "921600",
|
||||
"label": "921600"
|
||||
"key": "115200",
|
||||
"label": "115200"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -93,20 +93,20 @@
|
||||
"messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
|
||||
"options": [
|
||||
{
|
||||
"key": "460800",
|
||||
"label": "460800"
|
||||
"key": "921600",
|
||||
"label": "921600"
|
||||
},
|
||||
{
|
||||
"key": "115200",
|
||||
"label": "115200"
|
||||
"key": "460800",
|
||||
"label": "460800"
|
||||
},
|
||||
{
|
||||
"key": "230400",
|
||||
"label": "230400"
|
||||
},
|
||||
{
|
||||
"key": "921600",
|
||||
"label": "921600"
|
||||
"key": "115200",
|
||||
"label": "115200"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -118,16 +118,16 @@
|
||||
"type": "command",
|
||||
"portSelect": "all",
|
||||
"micropython:esp32c3:mixgo_cc": {
|
||||
"command": "\"{esptool}\" --chip esp32c3 --port {com} --baud {baudrate} write_flash -e 0x0 \"{indexPath}/build/Mixgo_CC_lib-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
|
||||
"command": "\"{esptool}\" --chip esp32c3 --port {com} --baud {baudrate} write_flash -e 0x0 \"{indexPath}/build/Mixgo_CC_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
|
||||
},
|
||||
"micropython:esp32c3:mixgo_me": {
|
||||
"command": "\"{esptool}\" --chip esp32c3 --port {com} --baud {baudrate} write_flash -e 0x0 \"{indexPath}/build/Mixgo_ME_lib-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
|
||||
"command": "\"{esptool}\" --chip esp32c3 --port {com} --baud {baudrate} write_flash -e 0x0 \"{indexPath}/build/Mixgo_ME_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
|
||||
},
|
||||
"micropython:esp32c3:mixgocar_c3": {
|
||||
"command": "\"{esptool}\" --chip esp32c3 --port {com} --baud {baudrate} write_flash -e 0x0 \"{indexPath}/build/Mixgo_Car_lib-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
|
||||
"command": "\"{esptool}\" --chip esp32c3 --port {com} --baud {baudrate} write_flash -e 0x0 \"{indexPath}/build/Mixgo_Car_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
|
||||
},
|
||||
"micropython:esp32c3:generic": {
|
||||
"command": "\"{esptool}\" --chip esp32c3 --port {com} --baud {baudrate} write_flash -e 0x0 \"{indexPath}/build/Generic_C3_UART_lib-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
|
||||
"command": "\"{esptool}\" --chip esp32c3 --port {com} --baud {baudrate} write_flash -e 0x0 \"{indexPath}/build/Generic_C3_UART_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
|
||||
}
|
||||
},
|
||||
"upload": {
|
||||
@@ -182,7 +182,7 @@
|
||||
"binFile": [
|
||||
{
|
||||
"offset": "0x0000",
|
||||
"path": "./build/Mixgo_CC_lib-v1.23.0.bin"
|
||||
"path": "./build/Mixgo_CC_lib-v1.25.0.bin"
|
||||
}, {
|
||||
"offset": "0x3A0000",
|
||||
"path": "../micropython/build/HZK12.bin"
|
||||
@@ -193,7 +193,7 @@
|
||||
"binFile": [
|
||||
{
|
||||
"offset": "0x0000",
|
||||
"path": "./build/Mixgo_ME_lib-v1.23.0.bin"
|
||||
"path": "./build/Mixgo_ME_lib-v1.25.0.bin"
|
||||
}, {
|
||||
"offset": "0x3A0000",
|
||||
"path": "../micropython/build/HZK12.bin"
|
||||
@@ -204,7 +204,7 @@
|
||||
"binFile": [
|
||||
{
|
||||
"offset": "0x0000",
|
||||
"path": "./build/Mixgo_Car_lib-v1.23.0.bin"
|
||||
"path": "./build/Mixgo_Car_lib-v1.25.0.bin"
|
||||
}, {
|
||||
"offset": "0x3A0000",
|
||||
"path": "../micropython/build/HZK12.bin"
|
||||
@@ -215,7 +215,7 @@
|
||||
"binFile": [
|
||||
{
|
||||
"offset": "0x0000",
|
||||
"path": "./build/Generic_C3_UART_lib-v1.23.0.bin"
|
||||
"path": "./build/Generic_C3_UART_lib-v1.25.0.bin"
|
||||
}, {
|
||||
"offset": "0x3A0000",
|
||||
"path": "../micropython/build/HZK12.bin"
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
21
boards/default/micropython_esp32c3/main.bundle.d88a2418.js
Normal file
21
boards/default/micropython_esp32c3/main.bundle.d88a2418.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user