can arduino serial.read() values??

 Serial.readBytesUntil('\n', buffer, 7);

The character array returned by this function is NOT null terminated.

 int incomingValue = atoi(buffer);

Therefore, it is NOT suitable input to atoi() which expects a NULL terminated array of chars.

this is just a sample that i have been modified, i just need to combine them together

First thing to do is define the requirements of the resulting program. Then, you pick the bits and pieces from each of the original programs that implement those requirements.