Compass in iPhone

Previous topic - Next topic

ampos

Just an idea...

Can we get the iPhone compass value in "getjoyrz"?

matchy

Quote from: ampos on 2010-Oct-07
Just an idea...

Can we get the iPhone compass value in "getjoyrz"?
:blink:
Great idea but not original and it's also in the iPad.
http://www.glbasic.com/forum/index.php?topic=4817.msg36591#msg36591
Why don't you have a go at creating a gyroscope wrapper? :zzz:

ampos

No "C" knowledge?

Also, the compass could be interpreted as a RZ axis compared to a joy...

matchy

Quote from: ampos on 2010-Oct-07
No "C" knowledge?
:rant:
Who else is going to do your homework? It's easy to learn how to create a wrapper. You don't need to know C or OBJC because there are many samples on the forum on how to implement one!

ampos

I didnt know what a "wrapper" is...  :whistle:

If GLB has implemented iphone accelerometer as joy, there is no real reason not to implement it on GLB. If your attitude is this, we wouldnt have accelerometer at all, just a bunch of "wrappers" to read iphone acc.

Of course, if Kitty has time for it, or wants to implement it.

It was just an idea to implement in GLB. Currently I dont need compass on any of my projects  :booze:

matchy

 :blink: Okay but did the link to the other thread help?

ampos

Nop, the last post is like chinese to me.  :S

ampos

Sorry, I mean that currently I dont need compass, thats why I will not learn (now) how to.

Thx anyway.

Kitty Hello

I'll add the gyro to the GETJOYRX and such when I have my iPhone 4.

AlienMenace

So, was this ever implemented?
Apps published: 3

trucidare

Hm good question. Kitty?
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

Kitty Hello

No, not yet. I'll put that on the todo as well...

AlienMenace

Cool, that would be fun to play around with.

Thanks!
Apps published: 3

Kitty Hello

The gyro information impacts the battery drain. I think it's better to release that addition as a library.


From the docs...
Code (glbasic) Select

    motionManager = [[CMMotionManager alloc] init];
    motionManager.gyroUpdateInterval = 1.0/60.0;
    if (motionManager.gyroAvailable) {
        opQ = [[NSOperationQueue currentQueue] retain];
        gyroHandler = ^ (CMGyroData *gyroData, NSError *error) {
            CMRotationRate rotate = gyroData.rotationRate;
            // handle rotation-rate data here......
        };
    } else {
        NSLog(@"No gyroscope on device.");
        toggleButton.enabled = NO;
        [motionManager release];
    }



shawnus

Hi,

I'd really like to use the gyroscope via GLB, but dont understand what a library is. That code looks like C, does that go into xcode somewhere?

cheers, Shawnus