accelerator updaterate
hi everyone
im new to appcelerator titanium and i wonder if its possible to increase the updaterate of the accelerometer. if im right im getting only all 91ms an update from the axis and i need more.
is it possibl to push the rate of measuring? or do i need to work with that info i got from it?
2 Answers
-
I encountered similar problem and here is my own solution.
Open your project by Xcode.
Update AccelerometerModule.m
Search[[UIAccelerometer sharedAccelerometer] setDelegate:self];
ABOVE the line, add the following code;
[[UIAccelerometer sharedAccelerometer] setUpdateInterval:(1.0/ [SAMPLING HZ])];
[SAMPLING HZ] is the rate you want to use ; e.g. SAMPLING HZ = 50 = 20ms
BUILD and RUN ; test it on your device.
-
hi guys,
is there a way to pass a variable from javascript to object-c code?i'd like to have something like that in javascript code:
var setUpdateInterval = 50;
and in object-c code have this:
[[UIAccelerometer sharedAccelerometer] setUpdateInterval:(1.0/50)];so i can change the update interval from javascript.
thx