build(boards): xpython板卡执行 npm run build:prod

This commit is contained in:
王立帮
2025-12-14 21:18:41 +08:00
parent 26bae5da89
commit 0ff5878d5f
416 changed files with 12404 additions and 48341 deletions

View File

@@ -17,9 +17,10 @@ class AGS10:
def __init__(self, i2c_bus, address=0x1A, delay=1000):
self._i2c = i2c_bus
self._addr = address
self._voc = None
self._voc = 0
self._delay = delay
self._star = 0
self.ready = 0
def _crc8(self, buf, is_byte=False):
'''Perform CRC check on the data'''
@@ -76,8 +77,8 @@ class AGS10:
if time.ticks_diff(time.ticks_ms(), self._star) >= self._delay:
self._star = time.ticks_ms()
_buf = self._rreg(_AGS10_ADC)
if (_buf[0] & 0x01) == 0:
self._voc = int.from_bytes(_buf[1:4], 'big')
self._voc = int.from_bytes(_buf[1:4], 'big')
self.ready = not (_buf[0] & 0x01)
return self._voc / 1000
def read(self, hcho_mw=30.033 , co2_mv=0.853, co2_base=400):