开发者

Accelerometer API for Laptops [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. 开发者_如何学编程

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 1 year ago.

Improve this question

Most IBM (and some Dell) laptops have built-in accelerometers to stop any moving parts during a sudden fall, but I was unable to find a standardised Windows API to access this data. I assume that each manufacturer would provide a driver to interface with the sensor.

  1. Which popular laptop brands come standard with accelerometers accessible from an API and which libraries should I use to access the data?
  2. Does an API* exist to abstract away the differences between different manufacturers? I am aware of the Windows 7 Sensor API, but I would like support for XP and earlier.


Most reputable notebook vendors have accelerometers to park the hard drive head if the notebook is accidentally dropped or is abruptly impacted by another object (i.e. when a certain acceleration threshold is exceeded). For example, my HP has its "HP 3D DriveGuard". However this technology is embedded low-level, it seems to work even if the OS is not loaded, so I suppose it is in the BIOS. I suppose that it is exposed just an ACPI way to enable or disable this technology. So, even on Windows 7 with standardized sensor APIs it is not accessible as a standard accelerometer like in a smartphone. Maybe in future if market demands it (but I don't think so).


This won't work for all manufacturers, but after much searching (I've been wanting this feature myself), I found somebody who wrote a driver wrapper for the accelerometers in HP laptops. If your laptop supports HP 3d DriveGuard or HP ProtectSmart, then this driver should let the accelerometer show up in the Windows sensor list.

  • 32-bit driver installer
  • 64-bit driver installer
  • example application (with source!)

Tested it out on my HP laptop and it installed without a hitch. The example program works, but it's pretty slow to respond. I don't think this would work well for high-precision needs (such as gaming), but it might work if you just need some slower orientation data.

Accelerometer API for Laptops [closed]

Note that this works by exposing the accelerometer to the Windows sensors API. The sensors API provides a standard method of accessing any type of sensor regardless of the actual hardware installed. There's more information about the Windows Sensor Platform on MSDN.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜