Merci pour ta réponse encore une fois ![]()
j'ai bien ajouter randomSeed :
void setup() {
Serial.begin(9600); //Start our Serial coms for serial monitor in our pc
mySerial.begin(9600); //Start our Serial coms for THE MP3
delay(500); //Wait chip initialization is complete
sendCommand(CMD_SEL_DEV, DEV_TF); //select the TF card
delay(200); //wait for 200ms
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
randomSeed(analogRead(A0));
}
void loop() {
if (measureDistance(trigPin, echoPin) < 10) {
int randTrackNo;
randTrackNo = random(1, 73);
sendCommand(0x03, randTrackNo);
Serial.print("Playing track:");
Serial.println(randTrackNo);
delay(1000); //wait to avoid errors
}
delay(300);
}
Mais je t'assure qu'il ne lit que les impaires...un truc de fou :o