On Feb 2, 11:57 am, kretes <[email protected]> wrote: > yes, my device wasn't entirely horizontal or vertical. > > However what I am looking for is function that will give me the same > value when the device is not in movement, but in any position, it can > be on a slant, it can be almost vertically, or in unknown position in > some pocket, but without movement. > > The problem is that I would like to be able to create a universal > function here, that would fit all accelerometer-enabled phones, not my > device. > > I guess I will let the user calibrate it by putting it horizontal > without movement and calculating maximum 'real force', multiplying it > by some constant like 1.2. > Or additionally ignore first/second 'shakes' and process next one, > which fill be kind-of filter for the peaks. > > Because I can't let myself accept any false positives. > > If somebody have a better solution - please tell. =================================================== The sqrt(xGs^2 +yGs^2 + zGs^2) should be 1 give or take a tenth G when not manuvering, so its an if statement on the magnitude of the Gs against a threshold value. Does this help? (I know more about accelerometers than I know about java...)
-- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

