How to Set hexadecimal data display format in the Terminal window  of the Hiwave?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to Set hexadecimal data display format in the Terminal window  of the Hiwave?

773 次查看
xiaochenqiang
Contributor II

Hi:

  I am working on the Virtual SCI,I have received date in the Terminal window,but I want the data display in hexadecimal format ,How to set it?Thank you!

标签 (1)
标记 (1)
0 项奖励
3 回复数

667 次查看
Martin35804
NXP Employee
NXP Employee

Hi,

you will have to make a conversion function from whatever format your get to hex.

or by using a printf function:

int a = 3;
printf
("0x%x\n", a);

this will give you 0x3

0 项奖励

667 次查看
iggi
NXP Employee
NXP Employee

The data (characters) you sent to PC terminal should be displayed as they were sent.

So, it depends on what you actually send to terminal.

In this case, a simple putc() would work.

//=============================int k;

 

for (k = 0; k<100; k++) {

     putc(k);

}

//=============================

btw, what MCU do you use?

0 项奖励

667 次查看
xiaochenqiang
Contributor II

why no one reply to the question?

0 项奖励