>Hi,
>
>Working on a web page that uses HTML5 DeviceOrientation which ties in to GeoLocation to provide 'bearing to destination'
>
>The problem I have is that most devices are very sensitive to device orientation - when I'm walking my indicator 'jitters' and because of this I want to dampen the incoming stream to provide a smoother display.
>
>I thought the obvious first step would be to maintain a buffer of x number of readings and use the average which should provide the desired result. But when the device is stationary no more input occurs and I need a way to settle on the final reading.
>
>Got a couple of approaches I might try but I'm wondering if anyone here can come up with a good algorithm..........
If I understand what you're saying ...
The latest reading is the correct one. Why not work with a timeout ?
You receive one input (reading), store it - but don't display it
The next input overwites the previous, etc
When timeout
- if there is input, display and clear the input
- if there is no input, don't do anything
Gregory