UART has me puzzled for hours... HELP!

How does the electric imp handle sending an integer that is greater than 8 bits? When I try to send out an integer value greater than 256 (dec) , my Arduino is only recieves one byte. I would have assumed that the Imp would send out either 16 bits to represent the number or 32 bits or something like this. This issue has had me puzzled for hours, please help!!!

Typically you would convert your integer into ASCII digits to send over a serial line, with a separator such as newline. Each UART write can only write one 7 or 8 bit character, and the job of the UART peripheral is to frame this with start and stop bits and transmit them serially. Most of the world will expect anything sent by a UART to be ASCII characters.

Okay great! Thank you for the clarification, that makes sense, it has been driving me crazy for the past day!

You can also split it into bytes like this, eg:

serial.write(format("%c%c", (value&0xff), (value>>8)));

…which sends the low byte first, then the high byte. You’d then recombine at the receiver into the 16 bit value.