Results 1 to 8 of 8
  1.    #1  
    Just for the record, with 1.1 we get more accelerometer support... except not fully it seems. Shaking now works... but ShakeStart and ShakeEnd do not, unless I'm doing something wrong. I tried the same syntax that I got shake to work with... even though the API page is entirely wrong. (And I tried it the original way too, and that gave worse errors).

    So basically, we're halfway there.
  2. kmax12's Avatar
    315 Posts
    Global Posts
    316 Global Posts
    what about getting raw accelerometer data? does that work? it didn't work before
  3.    #3  
    Quote Originally Posted by kmax12 View Post
    what about getting raw accelerometer data? does that work? it didn't work before
    Not sure myself, it doesn't help my application any so I haven't tested it.
  4. #4  
    I'm on it! Tossing code in as soon as I post this, I'll let ya know what I find out.
  5. #5  
    We are a GO!

    As a quick way to see it in action, if you use the Hello World code from the SDK documentation as a starting point, make the following changes:

    Add a function for handling the acceleration event:

    FirstAssistant.prototype.handleAcceleration = function(event) {
    	this.controller.get('count').update("X: " + event.accelX + "; Y:" + event.accelY + "; Z:" + event.accelZ + "; time: " + event.time);
    Then add the bind call to the FirstAssistant.prototype.setup function:

    FirstAssistant.prototype.setup = function() {
    	// ... other setup code ...
    	this.controller.listen(document, 'acceleration', this.handleAcceleration.bindAsEventListener(this));
  6. #6  
    Here's a little taste of some data...

    Remember, the Mojo SDK fires the "acceleration" event at a rate of 4Hz, so each data point is a quarter of a second apart. The basic rundown of what you're looking at is me tipping it back and forth upon the launch of the app, followed by shaking it in random ways. So really, there's nothing to be learned from it, other than showing off some data gleaned from it!

    My webcam sucks, but I may take some video and correlate movements to the data to give some meaningful idea of what is going on. Although I'd suppose such videos/animations/diagrams exist in the iPhone dev community somewhere, so I'll take a peek at that too.
  7. #7  
    Wow, that is truly awesome! Cant wait to see the apps that come out of this.
  8. #8  
    Here's something a little more meaningful. Holding the phone as near vertical as possible in my hand I started the app, ran down my hall and turned right as I crossed my living room before stopping. And yes—I looked like a dork and scared guests while doing it.

Posting Permissions