I’m trying to measure the speed of a wheel to control a synth. I’m using an arduino and Pduino. There is bits of papers taped to the wheel and they pass through a photo interrupter module. It’s using the digital output. I’m using the realtime-object to measure the time between papers passing the interrupter.
My question is why my output from [realtime] looks like this:
print: 9.917
print: 20.032
print: 19.994
print: 10.03
print: 10.025
print: 20.043
print: 18.553
print: 11.467
print: 20.026
print: 20.007
print: 9.879
print: 20.018
print: 8.59
print: 21.44
print: 10.032
print: 20.017
print: 20.02
print: 10.034
print: 18.484
print: 21.428
print: 10.032
And so on…
The numbers are always close to a multiple of 10. I can’t find a single integer ending with 2, 3, 4, 5, 6, or 7. Since I can se the numbers directly from the arduino (in arduino IDE) I’m pretty sure it’s not a problem at the arduino or sensor end of things. The numbers there looks totally reasonable to me. So, what is going on with my patch or with Pduino that makes it look like this? I could add that when using the timer-object there is nothing but exact multiples of 10:s outputted.
Also the stream of numbers I get is way to inconsistent for my uses and jumps around a lot. As you can see in the patch attached I’m using two [moving-ave] to smooth it out to something near acceptable. Is there limitations to using Pduino or is this again something in my patch.
Fairly new to PD and arduino so I’m sure there is a lot a can do better. Any help is appreciated. Thanks!
Patch:
PduinoTest.pd