Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Oiling my tablet
Message
De
29/04/2013 03:53:25
 
 
À
29/04/2013 03:34:49
Information générale
Forum:
Javascript
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01572116
Message ID:
01572117
Vues:
75
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform