×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Super Contributor
    Join Date
    Nov 2008
    Posts
    675

    Can we set the data rate for accelerometer sensor??

    Hi,
    I would like to understand if we can set the data rate/frequency of the accelerometer sensor in JSR 256.
    If no , then can we find the existing frequency.

    It is possible in Symbian to get the property to AccelerometerXYZ and then set the property.
    Is that doable in J2ME?

    Regards
    Biju

  2. #2
    Super Contributor
    Join Date
    Nov 2008
    Posts
    675

    Re: Can we set the data rate for accelerometer sensor??

    The API documentation says that by default the frequency is 40Hz and we cannot set the frequency in Java.
    So i understand that if i set the BufferSize to 1,the DataReceived should be called 40 times in a second or if i set the BufferSize to 40,then it should be called once every second. But for 40 , it is called only once in around 3secs. For my processing of the samples it is important i know the sampling rate and it not vary.. IS it doable in J2ME? Or else what can be done and what not ??

  3. #3
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Can we set the data rate for accelerometer sensor??

    I am afraid that the API documentation is all we got, if there are no methods thet meet your desired funcitonality then you can stop looking, you won';t be able to access the accelerometer in any other way than that api... maybe symbian/c++ gives more control, but it is known that j2me doesn't go very "deep" when it comes to hardware-interfaces...
    Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them.

  4. #4
    Super Contributor
    Join Date
    Nov 2008
    Posts
    675

    Re: Can we set the data rate for accelerometer sensor??

    Ok Tiger. So if it the document says it is 40Hz so i can safely trust the docs. Maybe i am getting it a bit slower because printing on screen at that rate would not be possible

  5. #5
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Can we set the data rate for accelerometer sensor??

    I have no idea what the max fps can be of a device, I do know some games do 25-30 fps so that should be achievable whilst printing to screen...
    Are you printing every single time to screen ? Or are you simply saving the system time when such a measurement is passed to your app and after some time (lets say 10 seconds) you print them all ?
    Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them.

  6. #6
    Super Contributor
    Join Date
    Nov 2008
    Posts
    675

    Re: Can we set the data rate for accelerometer sensor??

    Hi Tiger. I am testing on a N97 and like i mentioned before i can set a neat 50hz in SYmbian C++.
    Basically i set the buffer size to 40 and in Data received it print on screen. So with 40 fps , it should print every second as the buffer reaches 40 only in intervals of a second.
    But the print happens only once every 3 secs or so. This means that the default fps is slower than 40 or am I doing something wrong.

  7. #7
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Can we set the data rate for accelerometer sensor??

    ok but instead of writing the data received try to write the systemtime in that 40-items buffer, and then retrieve the first and the last and compare the time...
    Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them.

  8. #8
    Super Contributor
    Join Date
    Nov 2008
    Posts
    675

    Re: Can we set the data rate for accelerometer sensor??

    Ok..Will try that and let you know..

Similar Threads

  1. Stroke-rate meter using accelerometer?
    By jwshale in forum Symbian
    Replies: 0
    Last Post: 2009-12-14, 21:00
  2. Replies: 1
    Last Post: 2009-11-20, 20:46
  3. Sensor plugin accelerometer and rotation data
    By machiel in forum Symbian User Interface
    Replies: 16
    Last Post: 2009-09-08, 07:33
  4. Changing Data Rate of accelerometer.
    By olhed in forum Symbian User Interface
    Replies: 1
    Last Post: 2009-03-13, 12:42

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×