views:

56

answers:

2

does anyone knws how do i call it? public struct SmiAccelerometerVector { public float x; public float y; public float z; }

i want to get the x,y,z values and paste it into a label.

A: 

Samsung's documentation is unclear on the exact DLL that contains these functions, but I believe it would look like this:

public struct Vector 
{
    Single X;
    Single Y;
    Single Z;
}

[DllImport("SmiSDK.dll", SetLastError=true)]
public static extern int SmiAccelerometerGetVector(out Vector vector);
ctacke
A: 

thanks ctacke i got it already. Here it is :)

    private void GetVectorHandler(Accelerometer.Vector accel) 
    { 
        if (Accelerometer.GetVector(ref accel) == SmiResultCode.Success) 
         {
             yy = accel.y.ToString();
             xx = accel.x.ToString();
             zz = accel.z.ToString();
         } 
    }

after that we need to do this, inside form_load or wadeva

            GetVectorHandler(gVector);
            lblX.Text = "x: " + xx;
            lblY.Text = "y: " + yy;
            lblZ.Text = "z: " + zz;
cheesebunz