send the value as an ascii string with a recognizable line termination such as '\n'
instead of your recWithEndMarker(), see readBytesUntil() and it's use in the code posted in #9
void recvWithEndMarker() { static byte ndx = 0; char endMarker = '\n'; char rc; while (Serial.available() > 0 && newData == false) { rc = Serial.read(); if (rc != endMarker) { receivedChars[ndx] = rc; ndx++; if (ndx >= numChars) { ndx = numChars - 1; } } else { receivedChars[ndx] = '\0'; ndx = 0; newData = true; } } }