Get gyroscope data with permission access
npm install reactjs-gyroscopeThis package allows to read gyroscope data Gyroscope.
sh
yarn add reactjs-gyroscope
`Usage
`jsx
import { useEffect, useState } from 'react'
import { getGyroscope, gyroscopePermission } from 'reactjs-gyroscope';function App() {
const [start, setStart] = useState(false);
useEffect(() => {
if (start) {
getGyroscope((event) => {
console.log(event)
});
}
}, [start]);
return (<>
>);
}
export default App;
``Needs permission for deviceorientation event. (a.k.a. only using HTTPS).
LGPL-3.0