Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 568301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:10:27+00:00 2026-05-13T13:10:27+00:00

Id have an app that does one thing if you shake it one way,

  • 0

Id have an app that does one thing if you shake it one way, and another if you shake it the other.

atm my code is.

if (acceleration.x > 1.5) {

//arm to the right when facing you

    float duration = ([imageArray count]*0.04);

    //HUMAN EYE KEEPS IMAGES IN EYE For 40 MILLISECONDS//
    //NSLog(@"duration:%f", duration);
    [theFlash setAnimationImages:imageArray];
    [theFlash setAnimationRepeatCount:1];
    theFlash.animationDuration = duration;
    [theFlash startAnimating];
    NSLog(@"images flashed forward");   

}

if (acceleration.x < -1)
{
    //arm to the left when facing you

    float duration = ([imageArrayReversed count]*0.04);

    //HUMAN EYE KEEPS IMAGES IN EYE For 40 MILLISECONDS//
    NSLog(@"duration:%f", duration);
    [theFlash setAnimationImages:imageArrayReversed];
    [theFlash setAnimationRepeatCount:1];
    theFlash.animationDuration = duration;
    [theFlash startAnimating];
    NSLog(@"images flashed backward");  

}

the 1 and -1 values are working on it not being too sensitive.

however, this code is not giving me the results desired. Id like the images to flash (see the code) as soon as the person starts moving the device the other way.

Any way to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T13:10:28+00:00Added an answer on May 13, 2026 at 1:10 pm

    Well, you’re going to have to integrate the acceleration to get velocity. Unfortunately, the accelerometer is a bit noisy and will inevitably drift a bit, so you’re going to have to filter that integral. I think the filter described at http://www.musicdsp.org/showone.php?id=92 will do what you need, with the cutoff frequency set to around 1/4 the sampling frequency. You need the band output, and you’ll have to tune the resonance parameter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This one has me perplexed. I have a web app that does many functions,
I have a Rails app that does everything I need it to do via
I have an MVC app that does a lot of work with jQuery ajax
To clarify, I currently have a live app that does not implement in app
I have a 3rd party app that does a database export in to a
I have 2 js files. Although both do the same thing one does not
I have a nice little app on the app store that does pretty well
I recently created a Windows service. One thing that it faithfully does is log
We have a WinForms app, written in VB.NET (CLR 2.0), that does a lot
have an app that finds your GPS location successfully, but I need to be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.