Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Oiling my tablet
Message
From
29/04/2013 03:53:25
 
 
General information
Forum:
Javascript
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01572116
Message ID:
01572117
Views:
76
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform