eeui plugin install https://github.com/aipaw/eeui-plugin-accelerometer
eeui plugin uninstall https://github.com/aipaw/eeui-plugin-accelerometer
const accelerometer = app.requireModule("eeui/accelerometer");
- [
callback
] (Function)
result
(Object)-
x
(Float) (m/s^2) -
y
(Float) (m/s^2) -
z
(Float) (m/s^2)
-
accelerometer.get((ret) => {
console.log(ret)
})
-
[
options
] (Object)interval
(Int) (ms, default:32
)
-
[
callback
] (Function)
result
(Object)-
x
(Float) (m/s^2) -
y
(Float) (m/s^2) -
z
(Float) (m/s^2)
-
accelerometer.watch((ret) => {
console.log(ret)
})
- [
callback
] (Function)
accelerometer.clearWatch(() => {
console.log('cleared')
})
Error
ACCELEROMETER_PERMISSION_DENIED
ACCELEROMETER_NOT_SUPPORTED
ACCELEROMETER_INTERNAL_ERROR
GET_ACCELERATION_INVALID_ARGUMENT
WATCH_ACCELERATION_INVALID_ARGUMENT