dashgo_driver.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:dashgo 作者: EAIBOT 项目源码 文件源码
def __init__(self, port="/dev/ttyUSB0", baudrate=57600, timeout=0.5):

        self.PID_RATE = 30 # Do not change this!  It is a fixed property of the Arduino PID controller.
        self.PID_INTERVAL = 1000 / 30

        self.port = port
        self.baudrate = baudrate
        self.timeout = timeout
        self.encoder_count = 0
        self.writeTimeout = timeout
        self.interCharTimeout = timeout / 30.

        # Keep things thread safe
        self.mutex = thread.allocate_lock()

        # An array to cache analog sensor readings
        self.analog_sensor_cache = [None] * self.N_ANALOG_PORTS

        # An array to cache digital sensor readings
        self.digital_sensor_cache = [None] * self.N_DIGITAL_PORTS
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号