 	pinMode(pin_STATUS4, INPUT);
 }
 
-void sendStatus(lame, lameNumber){
-  int status = digitalRead(lame);
-  Serial.println("status de la lame %d : %d", lameNumber, status);
+void sendStatus(int lame, int lameNumber) {
+  int Status = digitalRead(lame);
+  Serial.print("status de la lame ");
+  Serial.print(lameNumber);
+	Serial.print(" : ");
+	Serial.println(lame);
   Udp.beginPacket(Udp.remoteIP(), 9694);
-  if (status)
+  if (Status)
     {
-      Udp.write(ReplyOn);
+      Udp.write(ReplyON);
     }
   else
     {
-      Udp.write(ReplyOff);
+      Udp.write(ReplyOFF);
     }
   Udp.endPacket();
 }

	int packetSize = Udp.parsePacket();
	if(packetSize) { // Si il y a un paquet
		Udp.read(packetBuffer,32); // le lire
		op = packetBuffer.substrings(4);
		lame = packetBuffer[4]-'0'; // et convertir le 5e caractére en chiffre (char -> int)
		switch(op) {
		case "lame":
		  switch (lame) {
		  case 1:
		    pin_LAME1 = HIGH;

		  Udp.beginPacket(Udp.remoteIP(), 9694);
		  Udp.write(ReplyBuffer);
		  Udp.endPacket();
	  } else if(op == "stat") {
		  switch(lame) {
 		  case 1:
		    sendStatus(pin_STATUS1, 1);
		    break;
		  case 2:
		    sendStatus(pin_STATUS2, 2);
		    break;
		  case 3:
		    sendStatus(pin_STATUS3, 3);
		    break;
		  case 4:
		    sendStatus(pin_STATUS4, 4);
		    break;
		  }
	}
}
	delay(10);
}
