This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP432E401Y: UART输出16进制

Part Number: MSP432E401Y

与某串口屏通信协议是发送3个FF,如何使用UARTprintf函数输出16进制格式的FF。

使用串口助手观察数据,未勾选16进制时:

勾选16进制后,ff变成了6666666

部分代码如下

下图为之前某32和串口屏通信使用的部分程序

希望工程师能告知,如何通过串口直接发送16进制的FF

  • 您使用下面的宏定义试试

    #define PRINT_X(x) UARTprintf("%s: %x", #x, x) // print a hexadecimal variable

    //! - \%x to print a hexadecimal value using lower case letters
    //! - \%X to print a hexadecimal value using lower case letters (not upper case
    //! letters as would typically be used)