My program is lagging while constantly sending serial?

Hi,

I wrote a program that reads the computer sounds, creates a spectrum, sends the serial data to my arduino, which then takes the info and displays it on LEDs. It works fine for the most part. It displays the leds fine, but the window itself is very laggy, to the point where I sometimes can't select the window. Also, sometimes after a while, the program decides to stop, and wont start over until I restart it.

I have that running on its own thread, which while refreshing about 40 times a second, sends 16 individual commands with each bars' value. Am I abusing the serial? Or is there something else going on?

Thanks

by Pandassaurus via /r/csharp

Leave a Reply