/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / MEMS_GetRotation()

Username:     
Password:     
             

Forum

# 1   2007-10-28 02:05:29 MEMS_GetRotation()

dalewheat
Member
From: Dallas TX USA
Registered: 2007-10-10
Posts: 43
Website

MEMS_GetRotation()

Issue #1:

MEMS_GetRotation() is defined in the documentation and the source code as taking a single parameter, a pointer to the enum 'Rotate_H12_V_Match_TypeDef', returning nothing.  The circle_api.h header file declares it s taking two parameters.

Rotate_H12_V_Match_TypeDef rotation;
MEMS_GetRotation ( &rotation );

...gives a compile error.  Adding a (fake) extra parameter makes the compiler happy:

MEMS_GetRotation (&rotation, 0 );

I think this is just a problem in the circle_api.h header file.

Issue #2:

The orientation value reported by the MEMS_GetRotation() function does not correspond with the current rotation of the screen.  It reports the current orientation of the STM32 Primer, which may not be the same thing.

This is a problem when an application needs to know the screen orientation to account for rotation of the MEMS data.  For example, a newly loaded application might be first in the list on the CicleOS menu.  Selecting this item requires the STM32 Primer to be tilted almost to the horizontal plane to be selected.  Once the application starts, MEMS_GetRotation() reports the current orientation (almost always V12) instead of the current rotation of the screen.

Perhaps I'm misunderstanding how this function is supposed to be used.  I'm trying to write a simple application that lets the user tilt the unit around to select one of several different options.  To interpret the MEMS data correctly, I need to know the current screen rotation to know which axes to monitor and for what polarity of values.

Any enlightenment would be appreciated.

Thanks,

Dale Wheat

Offline

 

# 2   2007-10-28 14:16:37 MEMS_GetRotation()

dalewheat
Member
From: Dallas TX USA
Registered: 2007-10-10
Posts: 43
Website

Re: MEMS_GetRotation()

In re Issue #2:

I found the right function to use:  LCD_GetScreenOrientation().

It makes sense.  MEMS_GetRotation() reports the current rotation of the unit, and LCD_GetScreenOrientation() returns the established orientation of the screen, which is really what I needed for this particular application.

Thanks,

Dale Wheat

Offline

 

Board footer