0.2.2 • Published 6 years ago

cordova-plugin-device-gyroscope v0.2.2

Weekly downloads
19
License
MIT
Repository
github
Last release
6 years ago

Cordova Gyroscope Plugin

This project is a fork of the old cordova-plugin-gyroscope published by Jason Yang. Thanks to him, this plugin is working.

Description

This project's idea is inspired from these two projects.

This project is merged by those two projects.

Installation

cordova plugin add cordova-plugin-device-gyroscope@0.2.2

Usage

This plugin is working like the Apache Cordova Accelerometer plugin, the API is the same.

Get the current gyroscope

navigator.gyroscope.getCurrentGyroscope(gyroscopeSuccess, gyroscopeError);

Watch the gyroscope

var watchID = navigator.gyroscope.watchGyroscope(gyroscopeSuccess,
                                                        gyroscopeError,
                                                        gyroscopeOptions);

Stop the watch of the gyroscope

navigator.gyroscope.clearWatch(watchID);