Accelerometer API for Laptops

你。 提交于 2019-12-04 01:20:55

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.

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!