當前位置: 首頁>>代碼示例>>Python>>正文


Python serial.SEVENBITS屬性代碼示例

本文整理匯總了Python中serial.SEVENBITS屬性的典型用法代碼示例。如果您正苦於以下問題:Python serial.SEVENBITS屬性的具體用法?Python serial.SEVENBITS怎麽用?Python serial.SEVENBITS使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在serial的用法示例。


在下文中一共展示了serial.SEVENBITS屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: getSerialOrNone

# 需要導入模塊: import serial [as 別名]
# 或者: from serial import SEVENBITS [as 別名]
def getSerialOrNone(portname):
    try:
       return serial.Serial(port=portname,baudrate=115200,parity=serial.PARITY_ODD,stopbits=serial.STOPBITS_TWO,bytesize=serial.SEVENBITS)
    except:
       return None 
開發者ID:utra-robosoccer,項目名稱:soccer-matlab,代碼行數:7,代碼來源:vrhand_vive_tracker.py

示例2: __init__

# 需要導入模塊: import serial [as 別名]
# 或者: from serial import SEVENBITS [as 別名]
def __init__(self,
                 path,
                 baudrate=9600,
                 timeout=1,
                 open_on_create=True,
                 debugging=False):
        super(TeliumNativeSerial, self).__init__(
            path,
            baudrate=baudrate,
            bytesize=SEVENBITS,
            parity=PARITY_EVEN,
            stopbits=STOPBITS_ONE,
            timeout=timeout,
            open_on_create=open_on_create,
            debugging=debugging) 
開發者ID:Ousret,項目名稱:pyTeliumManager,代碼行數:17,代碼來源:manager.py

示例3: __init__

# 需要導入模塊: import serial [as 別名]
# 或者: from serial import SEVENBITS [as 別名]
def __init__(self, port=None, connect_on_instantiation=False, soft_fail_for_testing=False):
        """
        Initializer of the MRHeiConnect class.

        Args:
            port (str): The port name/number of the hotplate
            connect_on_instantiation (bool): (optional) determines if the connection is established on instantiation of
                the class. Default: Off
            soft_fail_for_testing (bool): (optional) determines if an invalid serial port raises an error or merely logs
                a message. Default: Off
        """
        super().__init__(port, connect_on_instantiation, soft_fail_for_testing)

        # serial settings
        self.baudrate = 9600
        self.bytesize = serial.SEVENBITS
        self.parity = serial.PARITY_EVEN

        # answer patterns
        self.stranswer = re.compile("([0-9A-Z_]+)\r\n")
        self.intanswer = re.compile("([0-9A-Z_]+) (-?\d)\r\n")
        self.floatanswer = re.compile("([0-9A-Z_]+) (\d+\.\d+)\r\n")

        # implemented commands
        self.OLD_PROTOCOL = "PA_OLD"
        self.NEW_PROTOCOL = "PA_NEW"
        self.STATUS = "STATUS"
        self.GET_HOT_PLATE_TEMPERATURE_PV = "IN_PV_3"
        self.SET_TEMPERATURE_SP = "OUT_SP_1"
        self.GET_TEMPERATURE_SP = "IN_SP_1"
        self.START_HEATING = "START_1"
        self.WATCHDOG_ON = "CC_ON"
        self.WATCHDOG_OFF = "CC_OFF" 
開發者ID:croningp,項目名稱:ChemputerSoftware,代碼行數:35,代碼來源:Heidolph_MR_Hei_Connect.py

示例4: __init__

# 需要導入模塊: import serial [as 別名]
# 或者: from serial import SEVENBITS [as 別名]
def __init__(self, port=None, device_name=None, connect_on_instantiation=False, soft_fail_for_testing=False):
        """
        Initializer of the IKARV10 class
        :param str port: The port name/number of the rotavap (remember under Windows: COM15 -> port 14)
        :param str device_name: A descriptive name for the device, used mainly in debug prints.
        :param bool connect_on_instantiation: (optional) determines if the connection is established on instantiation of
            the class. Default: Off
        """
        super().__init__(port, device_name, soft_fail_for_testing)

        # serial settings
        self.baudrate = 9600
        self.bytesize = serial.SEVENBITS
        self.parity = serial.PARITY_EVEN

        self.write_delay = 0.1
        self.read_delay = 0.1

        # answer patterns
        self.stranswer = re.compile("([0-9A-Z_]+)\r\n")
        self.intanswer = re.compile("(\d+) (\d)\r\n")
        self.floatanswer = re.compile("(\d+\.\d+) (\d)\r\n")

        # DOCUMENTED COMMANDS for easier maintenance
        self.GET_ROTATION_PV = "IN_PV_4"
        self.GET_ROTATION_SP = "IN_SP_4"
        self.SET_ROTATION_SP = "OUT_SP_4"  # 20-280 RPM
        self.GET_TEMP_PV = "IN_PV_2"
        self.GET_TEMP_SP = "IN_SP_2"
        self.SET_TEMP_SP = "OUT_SP_2"  # 0-180°C, max. T is safety temperature minus 10°C, T>90°C switches to oil mode
        self.GET_SAFETY_TEMP_SP = "IN_SP_2"
        self.SET_SAFETY_TEMP_SP = "OUT_SP_2"
        self.START_TEMP = "START_2"
        self.STOP_TEMP = "STOP_2"
        self.START_ROTATION = "START_4"
        self.STOP_ROTATION = "STOP_4"
        self.RESET = "RESET"
        self.GET_NAME = "IN_NAME"
        self.SET_NAME = "OUT_NAME"
        self.GET_SOFTWARE_VERSION = "IN_SOFTWARE"
        self.SET_INTERVAL_SP = "OUT_SP_60"  # 1-60s, "0" switches mode off
        self.SET_TIMER_SP = "OUT_SP_61"  # 1-199min, "0" switches mode off
        self.LIFT_UP = "OUT_SP_62 1"
        self.LIFT_DOWN = "OUT_SP_63 1"

        self.MAX_RPM = 280

        self.MAX_RETRIES = 10

        self.heating_on = Event()  # communicator for switching the keepalive on or off

        self.launch_command_handler()

        if connect_on_instantiation:
            self.open_connection() 
開發者ID:croningp,項目名稱:ChemputerSoftware,代碼行數:57,代碼來源:IKA_RV10.py


注:本文中的serial.SEVENBITS屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。