!! Add below code in app_drv_i2c2.c !!
---------------------------------------------------------------------


---------------------------------------------------------------------
MPLAB Data Visualizer Exercise
---------------------------------------------------------------------
                unsigned char DVBuf[8] = { 0x03,
                                           AxisOutByte[0], AxisOutByte[1],
                                           AxisOutByte[2], AxisOutByte[3],
                                           AxisOutByte[4], AxisOutByte[5],
                                           0xFC };		
                USART2write( DVBuf, 8 );	

---------------------------------------------------------------------




---------------------------------------------------------------------
I2C Device Auto Probe Exercise
---------------------------------------------------------------------
        // I2C2Handle_TJ3 = DRV_I2C_Open(DRV_I2C_INDEX_1, DRV_IO_INTENT_READWRITE);
        // if(I2C2Handle_TJ3 == DRV_HANDLE_INVALID)
        // {
        //     app_drv_i2c2Data.state = APP_DRV_I2C2_STATE_ERROR;
        //     break;
        // }

        // I2C2WriteBuf_TJ3[0] = 0x1D;
        // I2C2WriteBuf_TJ3[1] = 0x80;
        // DRV_I2C_WriteTransferAdd( I2C2Handle_TJ3, KXTJ3_ADDRESS,
        //                                 I2C2WriteBuf_TJ3, 2, &I2C2WriteReadHandle_TJ3 );
        // while( DRV_I2C_TransferStatusGet(I2C2WriteReadHandle_TJ3) != 
        //                                             DRV_I2C_TRANSFER_EVENT_COMPLETE) {}
        // SYS_TIME_HANDLE TimeHandle;
        // SYS_TIME_DelayMS(10, &TimeHandle );
        // while(!SYS_TIME_DelayIsComplete(TimeHandle)) {}

---------------------------------------------------------------------
        for( int Inst = DRV_I2C_INDEX_0 ; Inst <= DRV_I2C_INDEX_1 ; Inst++ )
        {		   
            I2C2Handle_TJ3 = DRV_I2C_Open(Inst, DRV_IO_INTENT_READWRITE);
            if(I2C2Handle_TJ3 == DRV_HANDLE_INVALID)
            {
                app_drv_i2c2Data.state = APP_DRV_I2C2_STATE_ERROR;
                return;
            }
            I2C2WriteBuf_TJ3[0] = 0x1D;
            I2C2WriteBuf_TJ3[1] = 0x80;
            DRV_I2C_WriteTransferAdd( I2C2Handle_TJ3, KXTJ3_ADDRESS,
                                          I2C2WriteBuf_TJ3, 2, & I2C2WriteReadHandle_TJ3 );
 
            DRV_I2C_TRANSFER_EVENT TransferStatus;
            do
            {
                TransferStatus = DRV_I2C_TransferStatusGet(I2C2WriteReadHandle_TJ3);
                if( TransferStatus == DRV_I2C_TRANSFER_EVENT_ERROR )
                {
                    DRV_I2C_Close(I2C2Handle_TJ3);
                    break;
                }
            } while( TransferStatus != DRV_I2C_TRANSFER_EVENT_COMPLETE );

            SYS_TIME_HANDLE TimeHandle;
            SYS_TIME_DelayMS(10, &TimeHandle );
            while(!SYS_TIME_DelayIsComplete(TimeHandle)) {}

            if( TransferStatus == DRV_I2C_TRANSFER_EVENT_COMPLETE )
               break;
        }

---------------------------------------------------------------------
