 #define SDCARD_MOSI_PIN  7
 #define SDCARD_SCK_PIN   14
 
+// LEDS
 const byte ledPin1 = 13;
 const byte ledPin2 = 14;
-const byte sensorPin1 = 2;
-const byte sensorPin2 = 3;
+// Sensors
+const byte sensorPin1 = 5;
+const byte sensorPin2 = 6;
+// Sync
+const byte syncPin = 3; 
+const byte playPin =  4;
+bool play = 0;
+
+const char *tounes[] = {"toune1.wav", "toune2.wav", "toune3.wav", "toune4.wav"};
+int nbTounes = sizeof(tounes)/sizeof(tounes[0]);
+int currentSong = 0;
 
 void setup()
 {

	SPI.setMOSI(SDCARD_MOSI_PIN);
	SPI.setSCK(SDCARD_SCK_PIN);
	if (!(SD.begin(SDCARD_CS_PIN))) {
	  // stop here, but print a message repetitively
	  while (1) {
	    Serial.println("Unable to access the SD card");
	    delay(500);
	  }
	}
	dc1.amplitude(1.);
	dc2.amplitude(1.);
}

void loop()
{
	playFile("stereo.wav");
}

void playFile(const char *filename)
{
  Serial.print("Playing file: ");
  Serial.println(filename);

  // Start playing the file.  This sketch continues to
  // run while the file plays.
  playWav1.play(filename);

  // A brief delay for the library read WAV info
  delay(5);

  // Simply wait for the file to finish playing.
  while (playWav1.isPlaying()) {
  	rpmCounter1.update();
	  rpmCounter2.update();
    updateLed();
    // uncomment these lines if you audio shield
    // has the optional volume pot soldered
    float vol = analogRead(15);
    vol = vol / 1024;
    sgtl5000_1.volume(vol);
  }
}

void onRpm1(float val)


void updateLed1()
{
	if (digitalRead(sensorPin1) == HIGH) 
		digitalWrite(ledPin1, HIGH);
	else 
		digitalWrite(ledPin1, LOW);
}

void updateLed2()
{
	if (digitalRead(sensorPin2) == HIGH) 
		digitalWrite(ledPin2, HIGH);
	else 
		digitalWrite(ledPin2, LOW);
}

