Will supply some more test results by the end of the day.
I have attcahed the code above as it looks like the indenting got messed up.
BTW - THE FILTER IS NEEDED. It does a good job at normalising the raw input into a sine wave that crosses the boundaries consistantly. Without it the detection of the UP/DOWN thresholds would be a nightmare and so would accurate detection of the period of a steps. The only issue with the filter is the ringing which I have provided some good solutions to take that out of the problem.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Will supply some more test results by the end of the day.
I have attcahed the code above as it looks like the indenting got messed up.
BTW - THE FILTER IS NEEDED. It does a good job at normalising the raw input into a sine wave that crosses the boundaries consistantly. Without it the detection of the UP/DOWN thresholds would be a nightmare and so would accurate detection of the period of a steps. The only issue with the filter is the ringing which I have provided some good solutions to take that out of the problem.