import { onGyroscopeChange, startGyroscope, offGyroscopeChange } from '@ray-js/ray'
// 取消监听陀螺仪:先 onGyroscopeChange + startGyroscope 建立监听,再 offGyroscopeChange 取消
onGyroscopeChange(e => console.log(e));
startGyroscope({
interval: "normal",
success: () => {},
fail: error => console.error(error),
});
offGyroscopeChange(
() => console.log("已取消监听陀螺仪"),
error => console.error(error)
);