Read out "Sudden Motion Sensor" in Macbook Pro
2 ビュー (過去 30 日間)
古いコメントを表示
Has anybody out there ever tried to access
the "Sudden Motion Sensor" present in any
Macbook via Matlab? I searched the whole
web but couldn't find an obvious solution.
0 件のコメント
採用された回答
Ken Atwell
2013 年 7 月 6 日
I'm not aware of anyone having done this. Apple apparently does not provide a Cocoa API to it, leaving you with informal, "tinkers" interfaces. A Stack Overflow article has some suggestions -- you would need either write some MEX glue code to interface Objective-C to MATLAB, or you may be able to use loadlibrary.
Another option would be to use this library, written Java. MATLAB has an interface to Java, so in theory this may be the easiest option.
In all cases, it looks like the options out there may not have been updated in the last handful of years, so they may or may not work with modern hardware (I'm guessing here). Also note that newish SSD drives do not have this hardware in question.
2 件のコメント
Ken Atwell
2013 年 7 月 7 日
This library was compiled in 2006, so my first guess is an 32/64 bit issue. Run this in the Terminal window:
cd path/to/file
file libUnimotionLib.jnilib
The file libUnimotionLib.jnilib was compiled for PowerPC and 32-bit Intel. All MATLAB releases on the Mac in recent years are 64-bit apps. This C library will need to be recompiled for 64-bit. Off the top of my head, I don't know how to compile native C code into a JNI library, sorry.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で C Shared Library Integration についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!