Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Haptics - vibration repeat

Hi, two question here but both on the same topic.  Developing a clock-face where the vibration occurs on the hour and vibrates the hour value e.g. vibrates 5 times for 5 o'clock and so on.  However; the vibration only performs a single time, repeating of the vibration never happens.  Is there a requirement to put in a delay or check on the vibration returned value.

Example below (for example 5 o'clock)

 

for(let i = 0 ; i < 5; i++) {
vibration.start("Bump",1,45,1);
//vibration.stop();
}

 

Having read the, excellent forum entry reply from JonFitbit, the name seems to work, but not sure about the other settings, for example the repeat, time, strength and ramp.

 

https://community.fitbit.com/t5/SDK-Development/Haptics-documentation/td-p/2863953

 

thanks all.

Best Answer
0 Votes
2 REPLIES 2

You're basically restarting the vibration within milliseconds of the previous vibration.Javascript doesn't wait until the previous vibration has finished before proceeding.

 

Try using a setInterval().

Peter McLennan
Gondwana Software
Best Answer
0 Votes

@Snicket 

This post may be of use.

Author | ch, passion for improvement.

Best Answer
0 Votes