@areslabs/jdreact-plugin-sensors
v0.0.2
Published
传感器组件
Downloads
14
Keywords
Readme
Sensors
说明
传感器组件
安装
npm install @areslabs/jdreact-plugin-sensors --save
组件API
陀螺仪
import { gyroscope } from "@areslabs/jdreact-plugin-sensors";
const subscription = gyroscope.subscribe(({ x, y, z, timestamp }) =>
console.log({ x, y, z, timestamp })
);
setUpdateIntervalForType
import { setUpdateIntervalForType, SensorTypes } from "@areslabs/jdreact-plugin-sensors";
setUpdateIntervalForType(SensorTypes.gyroscope, 100);