omriharel / deej

Set app volumes with real sliders! deej is an Arduino & Go project to let you build your own hardware mixer for Windows and Linux
https://deej.rocks
MIT License
4.71k stars 433 forks source link

Send slider values only on change #98

Closed kgehmlich closed 5 months ago

kgehmlich commented 5 months ago

Prior to this patch, slider values would be sent on every loop. This is unnecessary and can make initial setup difficult (e.g. when using the serial monitor to verify outputs and correct pot behaviour).

This patch introduces a lastSliderValues array to track the last slider values that were sent to the PC and a MIN_CHANGE constant to set the minimum change required before sending the new slider values.

kgehmlich commented 5 months ago

I probably should have read CONTRIBUTING.md all the way to the end before opening this. I'll close this, but I'm happy to reopen if you like what it provides 😃