int byte_read = 0; ///< The current byte bool dataHasBeenReaden = false; char s[512] = ""; int cpt=0; void setup() { // put your setup code here, to run once: Serial.begin(9600); } void loop() // put your main code here, to run repeatedly: { dataHasBeenReaden = false; cpt = 0; while ( Serial.available() ) { dataHasBeenReaden = true; byte_read = Serial.read(); s[cpt] = byte_read; cpt++; //Serial.print("byte%i:"); } if (dataHasBeenReaden) { Serial.print("chaine recue et renvoyee:"); Serial.println(s); } delay(1000);