Hi,guys! I'm currently working on how to send character"hello" to FPGA and then transmit "hello" back to my PC. But it seems I only can send some characters to my board and cannot receive the chracters back to PC. I wonder how to build my code in python to get the characters back to my PC. The attachment is my code(PYTHON) and result of runing.
import serial
ser = serial.Serial("com9",9600,timeout=0.25)
print(ser.name)
print(ser.port)
#ser.open()
c=input("hello")
b=ser.isOpen()
s=ser.read(10)
ser.write(c.encode())
print(s)
print(b)
ser.close()
Question
weilai
Hi,guys! I'm currently working on how to send character"hello" to FPGA and then transmit "hello" back to my PC. But it seems I only can send some characters to my board and cannot receive the chracters back to PC. I wonder how to build my code in python to get the characters back to my PC. The attachment is my code(PYTHON) and result of runing.
import serial ser = serial.Serial("com9",9600,timeout=0.25) print(ser.name) print(ser.port) #ser.open() c=input("hello") b=ser.isOpen() s=ser.read(10) ser.write(c.encode()) print(s) print(b) ser.close()
Thanks,
Dehao
Link to comment
Share on other sites
8 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.