I have no idea now what it is you want to do.
Are you saying you want 34999 printed as four bytes worth (eight characters) of ASCII hex, or you just want to send four binary values over serial?
You need to no nothing to make that happen. Hex, decimal, octal, or binary are ways of viewing the value. The Arduino only knows one way to store the data - binary.
Why are you using a signed long to store the value? An unsigned int would make more sense, unless the values will exceed 65535, in which case sending two bytes won't be useful.
unsigned int val = 34999;
Serial.write(highByte(val));
Serial.write(lowByte(val));
PaulS:
You need to no nothing to make that happen. Hex, decimal, octal, or binary are ways of viewing the value. The Arduino only knows one way to store the data - binary.
Why are you using a signed long to store the value? An unsigned int would make more sense, unless the values will exceed 65535, in which case sending two bytes won't be useful.