I may be confused by your question, but you can try something like (just for this case to test):
printf("%c%c%c%c%c", 137, 0, 0, 128, 0);
This will send four characters encoded in ASCII with the numerical values you put afterwards.
Also, most technical documentation that tells you that you should use uint8
is refering that you send to the cable a full 8-bit value (speaking of characters here or ASCII then does not apply. They're just values of 8 bits that can be represented using an unit8
).
How this is usually done is by using some low-level functions such as write
, that can send an buffer of uint8
, so, if you have to send that values, you can have a buffer like this:
uint8 send_buffer[] = {137, 0, 0, 128, 0};
and then:
write (send_buffer, 5, output_file_or_serial_conn);