MMA8451Q Tilt

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
726件の閲覧回数
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 解決策
534件の閲覧回数
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 返信
535件の閲覧回数
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 件の賞賛