#Receieving side #Final without RX and TX basic from serial import Serial import bitarray import time import binascii serialPort = Serial("/dev/ttyUSB2", baudrate=9600, timeout=10) if (serialPort.isOpen() == False): serialPort.open() st = bitarray.bitarray() wfile = open("Out.txt", "w") while (serialPort.getDSR()): #print("Receiving...") pass #serialPort.getCTS() #start=time.time() for i in range(0, 40): st.append(serialPort.getCTS()) time.sleep(1) #print(st) #end=time.time() #print("Time Taken is ",(end-start)) print("Received Output without Rx and Tx is:") try:
# # swift.set_position(x=200, y=0, z=100) # time.sleep(5) # print(swift.get_polar()) # # # # # def test(ret): # # # print(ret) # # # # # # print(metal.send_cmd_sync('G0')) # # # metal.send_cmd_async('G0', callback=test) # # # # while True: # # time.sleep(1) import time from serial import Serial com = Serial("COM12", baudrate=115200) print('getCD:', com.getCD()) print('getCTS:', com.getCTS()) print('getDSR:', com.getDSR()) print('getRI:', com.getRI()) print('get_settings:', com.get_settings()) print('timeout:', com.timeout) while True: time.sleep(1)