Other Parts Discussed in Thread: DRV2605,
Both Adafruit and Sparkfun provide software support for the DRV2605 and select waveforms to play like this (Arduino target host):
void loop() {
Serial.print("Effect #"); Serial.println(effect);
// set the effect to play
drv.setWaveform(0, effect); // play effect
drv.setWaveform(1, 0); // end waveform
// play the effect!
drv.go();
// wait a bit
delay(500);
effect++;
if (effect > 117) effect = 1;
}
I'd like to understand the motive and effect accomplished with the drv.setWaveform(1,0) command here (saying "end waveform").
Some questions:
1. Say you write to start one effect waveform. Does it start right away or first verify there is not already a waveform being played? Does the "end waveform" write do anything to the status of the previous write - is the previous waveform guaranteed to play full length?
2. What happens if you write one effect waveform and then a 2nd right after, without the "end waveform" write? Do they still sequence correctly and both play out?
3. What would be a scenario where you would want to sequence several effect waveforms?
I'm not really a software guy so I am having a bit of trouble locating the file that contains the definition of drv.setWaveform and drv.go. Can you point that out to me? Either Sparkfun or Adafruit example ok.