示例#1
0
def Serial(baudrate, port='/dev/ttyACM1', timeout=1):
    if (port is '/dev/ttyACM1'):
        # Switch GPIO to UART on WeIO, this is not necessary if some other port is asked
        initSerial()
    return serial.Serial(port, baudrate, timeout=timeout)
示例#2
0
 def __init__(self):
     dev = "/dev/lpcUart"
     ser = initSerial(dev, 9600)
     ser.close()
     self.bus = UART_Adapter(dev)
示例#3
0
def Serial(baudrate, port='/dev/ttyACM1', timeout=1):
    if (port is '/dev/ttyACM1'):
        # Switch GPIO to UART on WeIO, this is not necessary if some other port is asked
        return initSerial(port, baudrate, timeout=timeout)
    else :
        return serial.Serial(port, baudrate, timeout=timeout)
示例#4
0
文件: ds18b20.py 项目: Capt-Cpt/weio
 def __init__(self):
     dev = "/dev/lpcUart"
     ser = initSerial(dev, 9600)
     ser.close()
     self.bus = UART_Adapter(dev)