Beispiel #1
0
 def connect(self):
     cont_ad = pfc_connection_arduino()
     port = cont_ad.get_USB_PORT()
     f = open(port)
     attrs = termios.tcgetattr(f)
     attrs[2] = attrs[2] & ~termios.HUPCL
     termios.tcsetattr(f, termios.TCSAFLUSH, attrs)
     f.close()
     self.SERIAL = serial.Serial(port, cont_ad.get_BAUD_RATE(), timeout=60)
Beispiel #2
0
 def connect(self):
     cont_ad = pfc_connection_arduino()
     port = cont_ad.get_USB_PORT()
     BRATE = cont_ad.get_BAUD_RATE()
     ser = serial.Serial(port, BRATE)
     # if ser.isOpen():
     # print("opend")
     # ser.close()
     while ser.isOpen():
         print("opened")
         print("IS CLOSED : " + str(ser.isOpen()))
         ser.close()
         time.sleep(1)