MMA8451Q Tilt

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

MMA8451Q Tilt

跳至解决方案
717 次查看
gaétanphilbiche
Contributor I

Hello,

I use a MMA8451Q to monitor a device that does not have to bend over x degrees to the vertical axis. Before I used a tilt switch CM1320-0 from Assemtech and wish to obtain the same result.

To do this , I thought used to detect portrait/landscape integrated. But I realize doing my tests that this mode is not the same if you turn around the Z axis or if the Z axis is tilted up or down.

Operation when turning around Z is perfect for my application, ideally I would have the same mode of operation on the other axis . But when I switch to the front ( Z down) , I have no hysteresis and backward (Z up) I hysteresis is too important! I tried to cheat the offset of the Z axis, but this is not enough.

I wonder if there is another solution that regularly read the MMA8451Q and make the angle calculation from the XYZ readings ? If there is no alternative , is there a sample source code?

Thank you

Best regards,

Gaétan

标签 (1)
0 项奖励
1 解答
525 次查看
gaétanphilbiche
Contributor I

Hi,

I finally meets self!

I chose to integrate the method provided in this datasheet: http://www.analog.com/static/imported-files/application_notes/AN-1057.pdf

On a PIC18 clocked at 8MHz, the computation time is 1.5ms, which is still reasonable.

Too bad, I have not found a solution to use the MMA8451Q with a interrupt, which would have saved me energy.

Rgards,

Gaétan

在原帖中查看解决方案

0 项奖励
1 回复
526 次查看
gaétanphilbiche
Contributor I

Hi,

I finally meets self!

I chose to integrate the method provided in this datasheet: http://www.analog.com/static/imported-files/application_notes/AN-1057.pdf

On a PIC18 clocked at 8MHz, the computation time is 1.5ms, which is still reasonable.

Too bad, I have not found a solution to use the MMA8451Q with a interrupt, which would have saved me energy.

Rgards,

Gaétan

0 项奖励