NeoLSN / cordova-plugin-gyroscope

Cordova Device Gyroscope Plugin
9 stars 14 forks source link

An example to use #5

Open mrbbp opened 7 years ago

mrbbp commented 7 years ago

I'm sorry, i'm a beat newb. I'm able to use deviceorientation in html5, but i'm lost with your plugin It would be kind to provide a code example. I don't know how to use it and how to have an answer... What kind of object is returned.... Sorry... Regards

NeoLSN commented 7 years ago

https://developer.android.com/guide/topics/sensors/sensors_motion.html#sensors-motion-gyro

pjardin commented 7 years ago

hey i need an example too please, and that does not really explain how to use this for intel xdk

ricopo1 commented 7 years ago

You can see example of use here: https://github.com/zanderso/cordova-plugin-gyroscope/blob/master/doc/index.md using the functions:

var gyroscope = navigator.gyroscope;
gyroscope.getCurrent
gyroscope.watch
gyroscope.clearWatch

When callback success you retrieve an object with the properties x,y,z,timestamp