Serial comm issue: would like to send message in hex

Hi, everyone,

I am trying to use xbee in api mode. Messages in hex form are sent and received. However, the pololu avr lib only provides a serial_send function which only accepts variable in char type(as I understanding, might be wrong, glad to hear comments). I am wondering if there is a way to modify it to act like Serial.print in arduino ide which allows us sending hex directly?

Thanks for concerns.

“hex” is just the set of characters 0…9a…f (or 0…9A…F), representing binary values, and you can certainly send those by Serial.print. This has been discussed many times in the Arduino forum e.g. forum.arduino.cc/index.php?topic=171733.0

Sorry if my expression make you misunderstood . I got the idea about “hex”. And I know how to use Serial.print in arduino ide. However, I am working in atmel studio environment, using pololu-avr lib which only contains a function like serial_send.

Thanks for your reply. And I figured it out that I can assign the char array to any number in hex directly. Define a char array and assign it, like char send_buffer[32] = {0x66,0x61...} , then call the serial_send function. I hope this won’t cause any problem.