Hi there,
I received my wav trigger and I have an issue with the commend “wTrig.isTrackPlaying”
I try to make led on when the command return true and to make led off when the command return false.
I have an issue that the command return false strait after the track is on before the track is finish. Is something wrong with my code?
void loop() {
// Call update on the WAV Trigger to keep the track playing status current.
wTrig.update();
for (int i = 0; i < numOfButtons; i++)
{
if (digitalRead(buttonPins[i]) == HIGH)
{
if(millis()-buttons_pressed[i]>=minTime)
{
buttons_pressed[i]=millis();//storing the time of button pressed in idex i
wTrig.trackPlayPoly(i+1); //play track number i poly
Serial.print("track number: ");
Serial.print(i+1);
Serial.println(" Is playing");
wTrig.update();
digitalWrite(ledPins[i],wTrig.isTrackPlaying(i+1));
if (!wTrig.isTrackPlaying(i+1)) {
Serial.print(i+1);
Serial.println(" Is done\n");
}
}
}
}
}
Thanks for any help!