WeChat Mini Program API Gravity Sensing
wx.onAccelerometerChange(CALLBACK)
Monitor gravity sensing data, frequency: 5 times/second
CALLBACK return parameters:
Sample code:
wx.onAccelerometerChange(function(res) { console.log(res.x) console.log(res.y) console.log(res.z) })