Your original question failed to mention the serial port. You send bytes (8 bit values) to the serial port, and bytes are received on the other end of the serial connection. Bytes can represent ASCII characters or binary data.
You write a program that determines which bytes are sent, and write a program to receive and interpret them correctly on the other end. Several bytes are often used to represent individual values.