/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / Setting Neutral Position

Username:     
Password:     
             

Forum

# 1   2008-05-16 20:25:31 Setting Neutral Position

PhilG
New member
Registered: 2008-05-06
Posts: 1

Setting Neutral Position

Hi,
I wish to set the neutral MEMS position to be horizontal. I have read in other posts that this can be done by calling the function MEMS_SetNeutral(). I have tried this in the Application_Ini section but it does not appear to work.
Please can anyone suggest a solution.
Regards
Phil.

Offline

 

# 2   2008-05-19 09:34:41 Setting Neutral Position

Francis
Administrator
From: France-Grenoble
Registered: 2007-07-09
Posts: 890

Re: Setting Neutral Position

You are right... The code of MEMS_SetNeutral is the following:
void MEMS_SetNeutral( void )
   {
   // Set Neutral position.
   MEMS_GetPosition( &XInit, &YInit );
   }
with:
void MEMS_GetPosition( s16* pX, s16* pY )
   {
   *pX = MEMS_Info.OutX - XInit;
   *pY = MEMS_Info.OutY - YInit;
   }


I guess it should be (to be tested):
void MEMS_SetNeutral( void )
   {
   XInit = MEMS_Info.OutX ;
   YInit = MEMS_Info.OutY;
   }

Offline

 

Board footer