https://github.com/gmartigny/vibrisse
😺 Swiftly read device's spatial sensors
https://github.com/gmartigny/vibrisse
accelerometer compass gyroscope mobile-development sensor
Last synced: 3 days ago
JSON representation
😺 Swiftly read device's spatial sensors
- Host: GitHub
- URL: https://github.com/gmartigny/vibrisse
- Owner: GMartigny
- License: mit
- Created: 2020-07-07T11:49:03.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-17T09:48:30.000Z (over 4 years ago)
- Last Synced: 2024-05-02T01:25:59.619Z (12 months ago)
- Topics: accelerometer, compass, gyroscope, mobile-development, sensor
- Language: JavaScript
- Homepage:
- Size: 44.9 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: .github/funding.yml
- License: license
Awesome Lists containing this project
README
# Vibrisse
[](https://www.npmjs.com/package/vibrisse)
Swiftly read device spacial sensors
## Installation
npm install vibrisse
## Usage
```js
import { listen, sensors } from "vibrisse";const api = listen(sensors.RadialAcceleration + sensors.LinearAcceleration, (readings) => {
const radial = readings[sensors.RadialAcceleration];
const linear = readings[sensors.LinearAcceleration];
// ...
});
api.start();// Later
api.stop();
```### Available sensors
- `Orientation` - Read the gravity and its direction applied to the device
- `RadialAcceleration` - Read the change in rotation momentum of the device
- `LinearAcceleration` - Read the change in linear momentum of the device
- `RelativeOrientation` - Read the change in orientation relative to when the sensor is set up (quaternion)
- `AbsoluteOrientation` - Read the change in orientation relative to the Earth (quaternion)## License
[MIT](license)