I run into a small performance issue.
I read an encoder and send a torque value (DAC) to a DC motor.
My control loop runs at 200Hz, using a Timer.
Everything works well, except when I try to send some data to the PC.
I use USB_VCP
Code: Select all
u = pyb.USB_VCP()
Code: Select all
u.write(str(nbtop))
But as soon as I use the u.write(), it damages my control loop (encoder=>torque value), it still works, but less good.
I guess that u.write() uses to much time.
Is there a way to improve it?