01-16-2020 02:09 AM
Hi everyone.
Now I'm mearsuring analog signal from the strain sensor using Arduino!
When I got the signal in real time, I found Min/Max Value and using values to mapping&scaling.
But sometimes, high value(noise) from unstable electrode. that caused the problem in mapping range.
So I just want to fix the Min/Max value without noise.
For example, I want to receive analog signals for only 5 seconds and use the minimum maximum of them. Not the min/max in real time.
How can i adjust the time or number of analog signal recived??
Using Another loop? or Is there the way to maintain the min/max value which set first 5 second?
Solved! Go to Solution.
01-16-2020 02:15 AM - edited 01-16-2020 02:16 AM
Hi jdb,
do you know the sample rate of your data?
Then just collect "sample rate * 5 seconds" of data in an array and get min/max of that array!
Otherwise use a (while) loop to read samples and stop the loop using ElapsedTime set to "5s" to collect your sample array…
(Nice to see you finally created your scaling function! :D)
01-16-2020 02:16 AM - edited 01-16-2020 02:18 AM
Put the elements in an array, put the array in a shift register. If the array gets bigger than the nr. of elements, use Delete Array Elements to get the most recent nr. of elements. That will give you a point-by-point history of nr. of elements.
There's actually a build in function "Array Max & Min PtByPt.vi" (use Quick drop) that does this.
01-16-2020 02:18 AM
Hi Wiebe,
wiebe@CARYA wrote:
That will give you a point-by-point history of nr. of elements.
This basically is the same as the PtByPt-DataQueue!?