Serial.readBytesUntil();

I would like to kinow whar is the code to read the serial until the enter key is pressed
here is my code:

while(!Serial.available()); byte choix = Serial.readBytesUntil('\n');

but i’ve got an error

Check Arduino documentation readBytesUntil(). This function returns an array not a byte

Alain46: Check Arduino documentation readBytesUntil(). This function returns an array not a byte

what should i had int the command

Serial.readBytesUntil(character, buffer, length)

You should read the documentation :
https://www.arduino.cc/en/Reference/StreamReadBytesUntil

void loop() {
 char buffer[16];
 while(!Serial.available());
 int size = Serial.readBytesUntil('\n', buffer, 16);
 for (int i = 0 ; i < size ; i++) {
   Serial.println(buffer[i], HEX);
 }
}

Hope it helps …

Have a look at the examples in Serial Input Basics - simple reliable ways to receive data.

...R