Python: comunicación en serie; función de sueño
Frecuentes
Visto 318 veces
1
I have been trying to send some data from python to a FPGA for processing. Due to some constraints on the receiving side, i had to introduce a sleep.
El código es el siguiente:
for rowNum in range(640):
for colNum in range(480):
for depth in range(64):
x = ser.write(imageArray[depth][colNum][rowNum])
sleep(0.001)
The size of the data I am sending is 640*480*64 at a baud rate of 115200bps. Ideally, it should take, (640*480*64 ms + 640*480*64*10/115200 seconds which is ~6 hours) The *10 is because of the number of bits in my one byte.
But, my transfer is taking more than 24hours. Any idea why this is happening? The reception side has no problems.
¡Gracias!
0 Respuestas
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas python sleep serial-communication or haz tu propia pregunta.
How long does it take if you comment out the
ser.write()
line? That'll tell you whether the problem lies withser.write()
o en algún otro lugar. - NPE