How to smooth out values coming from arduino

hi guys,

i am reading values coming from a potentiometer connected to a arduino-board using this aproach:

but: the values i get are quite jumpy. i want to use these inputs to control the position of the “playhead” on a video timeline, using “do seek” of the filestream node. therefore i would need values, that don t “jump” a lot.

so, does anybody know a method how to smooth out those values. for now i tried to get a hold of that problem moving the comma by one step and cutting away the decimals. therefore i got rid of most of the jumping values.

it would be nice if you would share your ideas.


control_vid_poti_gerundet.v4p (748 Bytes)

Hello oha , the patch you uploaded is sort of empty probably you used some subpatches and staff that are missing , I attached 2 arduino basic poti exercises that i did for some workshops , i,ll upload a bunch of them next time i update my userpage , hope is good for you , sorry comments are in spanish but i think you,ll manage to get what is going on ,cheers (198.3 kB)

hey colorsound, thanks for your quick reply. spanish is great! ahhhh espannia… well, that doesn t really fit here… so, here we go:

sry for uploading a junk-patch. i ll try to post my approach again… it s basically the combination of two things i found here in the forums…

i m still open for suggestions, since just damping the values doesn´t really help, cause if you have an instable value, it stays instable even if you damp it…


poti_rounded.v4p (14.3 kB)

hi again oha , I think your problem comes with the combination of your arduino code and your patch , probably a tokenizer staff there , do you get like big jumps of the value ? please check this exercise which is one of the above with slight changes and a quick english translation , i just tested all and work well, remember to upload the arduino code that comes with this exercise , good luck mate (3.6 kB)

there are some discussions on the forum about Arduino communication and Tokenizer - i have put some of the gems in the node reference at Tokenizer (String) .

also: remember that the microcontroller on the arduino can poll values a lot faster than vvvv displays frames. for a relatively simple task like polling a single potentiometer, i would recommend writing your own little script that checks the value on the analogue port around 30-40 times and then sends the median of these to vvvv. you get very nice smooth values from that, without using any heavy filters.