1/10/2013

3DM-GX3 IMU sensor - Data acquisition source code

3DM-GX3 IMU sensor - Data acquisition source code


Code is made by Visual studio 2008(C++).


There is "3DM_GX3_interface" class In the source code.
You can get IMU data easily using the class.



//Open Port 
CString strPort = "COM7";
int baudrate = 115200; //19200;
int data = 8;
int parity = 0;
int stop = 0;//1;
C3DM_GX3.OpenPort2(strPort,baudrate,data,parity,stop);


//Request Data to the IMU, This function need one time when start to acquisition.
C3DM_GX3.SendData()

//Get Data loop until end.
C3DM_GX3.ReceiveData.roll/3.14*180 ;
C3DM_GX3.ReceiveData.pitch/3.14*180 ;
C3DM_GX3.ReceiveData.yaw/3.14*180 ;

//Close Port
C3DM_GX3.ClosePort();




"How to change 4byte bit data to float" is used to get the roll, yaw, pitch.
The method is introduced on my blog here.


this code is useful to you.
Thank you.

1 comment:

  1. Hi Kim!

    I can,t download acquisition code for: "3DM-GX3 IMU sensor - Data acquisition source code "

    can you help me, how to download it....

    regards!

    meo ;
    ANSAN KOREA

    ReplyDelete