Results 1 to 9 of 9
  1. kmax12's Avatar
    315 Posts
    Global Posts
    316 Global Posts
    as probably everyone here knows, palm offically released the SDK. It's nice cause is it includes a lot of documentation.

    The following is the Accelerometer documentation.
    Accelerometer €“ webOSdev €“ Palm

    It describes how todo things like changing the screen, but I am interested in the raw data api. For the life of me cannot figure out how to get it to out put the raw data. below is my attempt to out but the X-axis g's

    I have the following in my code:

    FirstAssistant.prototype.setup = function() {
    this.controller.listen(document, 'acceleration',this.handleAcceleration.bindAsEventListener(this));

    FirstAssistant.prototype.handleAcceleration = function(event){
    this.x = event.accelX;
    this.controller.get('xaxis').update(this.x); \\ refers to a title in the html

    so, can anyone help me? I am sure other devs are interested in incoperating the Accelerometer into there apps.
  2. #2  
    I'm working on this as dice. The code listed in the API reference docs for the simple orientation change doesn't work either, but the code from the "APIs" sample app does work:

    OrientationAssistant.prototype.orientationChanged = function(orientation){
    //This is the way to watch for changes in orientation
    this.showDialogBox("Orientation Changed", orientation);

    And that works in and of itself, no call to setup a listener callback... I'm curious if there's something like that hidden away for the raw data. Any help is much appreciated!
  3. adsllc's Avatar
    46 Posts
    Global Posts
    47 Global Posts
    I've done some rooting around in $and$ $I$'$m$ $starting$ $to$ $think$ $that$ $it$'$s$ $not$ $yet$ $possible$.

    There are some Mojo.Service.Request() entries that would appear to turn the accelerometer service on, but they are commented out. Putting the entries in my code results in a service request failure.

    Further, the service name is "palm://com.palm.crotest", the name leads me to believe that it's not meant for public consumption.

    Given all this, and some obvious errors in the API itself, I think this may have to wait for webOS 1.0.5.

    The orientationChanged() member works fine as randallagordon mentioned, but it only gets called once per rotation event instead of continuously.
  4. #4  
    Come to think of it, the Services app in the samplecode file includes the Accelerometer but it states "Work in Progress" and is not available.

    Guess adsllc is correct. It's just not ready for prime time yet.
  5. rmbwebs's Avatar
    129 Posts
    Global Posts
    145 Global Posts
    Has anyone been able to confirm the existence of an accelerometer and not just a screen orientation sensor?
  6. atlanta's Avatar
    324 Posts
    Global Posts
    337 Global Posts
    Quote Originally Posted by rmbwebs View Post
    Has anyone been able to confirm the existence of an accelerometer and not just a screen orientation sensor?
    lol . the screen orientation sensor is the accelerometer
  7. rmbwebs's Avatar
    129 Posts
    Global Posts
    145 Global Posts
    Quote Originally Posted by atlanta View Post
    lol . the screen orientation sensor is the accelerometer
    But can it make minute measurements in acceleration on 3 axes, or can it merely make a good guess on the orientation of the screen?

    There are plenty of devices that have screen orientation sensors but don't have accelerometers (as we use the term at least).
  8. #8  
    It gives 3D acceleration data at 4 Hz... At least via the Mojo SDK, and furthermore, as it seems, at least in a future firmware update.

    My guess would be the 4Hz limitation is simply so the framework doesn't get absurdly flooded with acceleration events. I'm hoping that is the case, anywho... I'd be curious to know if anyone has done any tinkering with the accelerometer a little closer to hardware level, yet...

    And atlanta is correct, that's how "screen orientation" works. All comes down to how sensitive the accelerometer is and how many axes it detects. And, more important, if meaningful data can be acquired through the device's API, beyond just orientation, as we're trying to get kick started here.
  9. #9  
    Firmware update 1.1 enables both shaking support and RAW!

    More on this post:

Posting Permissions