v1.2.8
This commit is contained in:
19
hardware.py
19
hardware.py
@@ -25,7 +25,6 @@ class HardwareManager:
|
||||
|
||||
# 私有硬件对象
|
||||
self._uart4g = None # 4G模块UART
|
||||
self._distance_serial = None # 激光测距串口
|
||||
self._bus = None # I2C总线
|
||||
self._adc_obj = None # ADC对象
|
||||
self._at_client = None # AT客户端
|
||||
@@ -39,11 +38,6 @@ class HardwareManager:
|
||||
"""4G模块UART(只读)"""
|
||||
return self._uart4g
|
||||
|
||||
@property
|
||||
def distance_serial(self):
|
||||
"""激光测距串口(只读)"""
|
||||
return self._distance_serial
|
||||
|
||||
@property
|
||||
def bus(self):
|
||||
"""I2C总线(只读)"""
|
||||
@@ -71,19 +65,6 @@ class HardwareManager:
|
||||
self._uart4g = uart.UART(device, baudrate)
|
||||
return self._uart4g
|
||||
|
||||
def init_distance_serial(self, device=None, baudrate=None):
|
||||
"""初始化激光测距串口(激光控制)"""
|
||||
from maix import uart
|
||||
if device is None:
|
||||
device = config.DISTANCE_SERIAL_DEVICE
|
||||
if baudrate is None:
|
||||
baudrate = config.DISTANCE_SERIAL_BAUDRATE
|
||||
|
||||
print(f"[HW] 初始化激光串口: device={device}, baudrate={baudrate}")
|
||||
self._distance_serial = uart.UART(device, baudrate)
|
||||
print(f"[HW] 激光串口初始化完成: {self._distance_serial}")
|
||||
return self._distance_serial
|
||||
|
||||
def init_bus(self, bus_num=None):
|
||||
"""初始化I2C总线"""
|
||||
from maix import i2c
|
||||
|
||||
Reference in New Issue
Block a user