调整元控自强板卡,I2C设备启动顺序
This commit is contained in:
Binary file not shown.
@@ -19,16 +19,9 @@ onboard_i2c = SoftI2C(scl=Pin(47), sda=Pin(48), freq=400000)
|
|||||||
'''SPI-onboard'''
|
'''SPI-onboard'''
|
||||||
onboard_spi = SPI(1, baudrate=50000000, polarity=0, phase=0)
|
onboard_spi = SPI(1, baudrate=50000000, polarity=0, phase=0)
|
||||||
|
|
||||||
'''TFT/320*240'''
|
'''TFT/240*240'''
|
||||||
onboard_tft = st7789_cf.ST7789(onboard_spi, 240, 240, dc_pin=40, cs_pin=None, bl_pin=None, font_address=0xE00000)
|
onboard_tft = st7789_cf.ST7789(onboard_spi, 240, 240, dc_pin=40, cs_pin=None, bl_pin=None, font_address=0xE00000)
|
||||||
|
|
||||||
'''BOT035-Sensor'''
|
|
||||||
try :
|
|
||||||
import sant_bot
|
|
||||||
onboard_bot = sant_bot.BOT035(onboard_i2c)
|
|
||||||
except Exception as e:
|
|
||||||
print("Warning: Failed to communicate with BOT035 (Coprocessor) or",e)
|
|
||||||
|
|
||||||
'''ACC-Sensor'''
|
'''ACC-Sensor'''
|
||||||
try :
|
try :
|
||||||
import sc7a20
|
import sc7a20
|
||||||
@@ -50,13 +43,6 @@ try :
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("Warning: Failed to communicate with GXHTC3 (THS) or",e)
|
print("Warning: Failed to communicate with GXHTC3 (THS) or",e)
|
||||||
|
|
||||||
'''ASR-Sensor'''
|
|
||||||
try :
|
|
||||||
import ci130x
|
|
||||||
onboard_asr = ci130x.CI130X(onboard_i2c)
|
|
||||||
except Exception as e:
|
|
||||||
print("Warning: Failed to communicate with CI130X (ASR) or",e)
|
|
||||||
|
|
||||||
'''MGS-Sensor'''
|
'''MGS-Sensor'''
|
||||||
try :
|
try :
|
||||||
import mmc5603
|
import mmc5603
|
||||||
@@ -71,6 +57,20 @@ try :
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("Warning: Failed to communicate with SPL06-001 (BPS) or",e)
|
print("Warning: Failed to communicate with SPL06-001 (BPS) or",e)
|
||||||
|
|
||||||
|
'''BOT035-Sensor'''
|
||||||
|
try :
|
||||||
|
import sant_bot
|
||||||
|
onboard_bot = sant_bot.BOT035(onboard_i2c)
|
||||||
|
except Exception as e:
|
||||||
|
print("Warning: Failed to communicate with BOT035 (Coprocessor) or",e)
|
||||||
|
|
||||||
|
'''ASR-Sensor'''
|
||||||
|
try :
|
||||||
|
import ci130x
|
||||||
|
onboard_asr = ci130x.CI130X(onboard_i2c)
|
||||||
|
except Exception as e:
|
||||||
|
print("Warning: Failed to communicate with CI130X (ASR) or",e)
|
||||||
|
|
||||||
'''2RGB_WS2812'''
|
'''2RGB_WS2812'''
|
||||||
from ws2812 import NeoPixel
|
from ws2812 import NeoPixel
|
||||||
onboard_rgb = NeoPixel(Pin(21), 4)
|
onboard_rgb = NeoPixel(Pin(21), 4)
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class ST7789(uframebuf.FrameBuffer_Uincode):
|
|||||||
self.font(font_address)
|
self.font(font_address)
|
||||||
self._init()
|
self._init()
|
||||||
self.show()
|
self.show()
|
||||||
time.sleep_ms(100)
|
time.sleep_ms(200)
|
||||||
self._brightness = 0.6
|
self._brightness = 0.6
|
||||||
self.bl_led = PWM(Pin(bl_pin), duty_u16=int(self._brightness * 60000)) if bl_pin is not None else None
|
self.bl_led = PWM(Pin(bl_pin), duty_u16=int(self._brightness * 60000)) if bl_pin is not None else None
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user