Replies: 2 comments 8 replies
-
Use the
https://docs.zepp.com/docs/1.0/watchface/api/timer/createTimer/ |
Beta Was this translation helpful? Give feedback.
1 reply
-
Hi, please refer to the sample code of the vibration sensor, it is recommended to call the https://docs.zepp.com/docs/1.0/reference/device-app-api/hmSensor/sensorId/VIBRATE/ const vibrate = hmSensor.createSensor(hmSensor.id.VIBRATE)
function click() {
vibrate.stop()
vibrate.scene = 25
vibrate.start()
}
click()
Page({
onDestroy() {
vibrate && vibrate.stop()
}
}) |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi guys, I want to realize a sort of metronome app with the ability to set a time in ms and use it when you are playing instruents. Your watch have to be setted up with an interval in MS and has to vibrate every XXXXms .
I tried with:
setInterval(() => {
const vibrate = hmSensor.createSensor(hmSensor.id.VIBRATE);
vibrate.start();
vibrate.setMode(VIBRATOR_SCENE_DURATION_LONG);
vibrate.start();
}, 1000)
But it only vibrate once!
How can i do it?
Beta Was this translation helpful? Give feedback.
All reactions