将 MPU6050 与 Windows 10 IoT (windows.devices.sensors) 集成

Integrate MPU6050 with Windows 10 IoT (windows.devices.sensors)

我目前正在使用 Windows 10 IoT 和 RaspberryPi 3b + MPU6050 通过 I2C 连接。

环顾四周,我发现 windows.devices.sensors.accelerometer 和 windows.devices.sensors.gyrometer。 我认为这些 类 可以在 Windows 手机上使用以访问 Sensorreadings,所以我想知道:

是否可以将我的 MPU6050 传感器板加速度计和陀螺仪集成到这些 类 中?

通过I2C连接MPU6050和Windows IoT Core可以参考“Windows 10: How to use IoT extension for Raspberry Pi 2 (part 2)" and "MPU6050 Accelerometer on Windows 10 Raspberry 2”。

如果你想检查windows.devices.sensors.accelerometer API 工作与否,你可以参考“UWP sample - Accelerometer sample”。但是要使用这些 API 需要支持传感器。您可能需要相关的驱动程序。

The driver for a sensor must indicate that the hardware is integrated with the PC chassis for it to be accessible via this namespace. Sensors not marked as PC-integrated, even if they are of a supported type, will not be accessible. Driver developers can refer to SensorConnectionType enumeration for more details. (Windows.Devices.Sensors Namespace)