【发布时间】:2014-10-09 05:39:44
【问题描述】:
基本上我想做的是
例如:'a' hex 等价物是0x61,我可以将61 拆分为6 和1 并将它们存储为'6' 和'1' 吗?
缓冲区正在接收这样的数据:
rx_dataframe.data[0] is H'00,'.'// H' is Hex equivalant and '' is ASCII value
rx_dataframe.data[0] is H'31,'1'
rx_dataframe.data[0] is H'32,'2'
rx_dataframe.data[0] is H'33,'3'
我需要将hex values 0x00,0x31,0x32,0x33 转换为字符值'0','0','3','1','3','2';'3','3'
并将它们存储在tx_buff_data[];的位置
我希望我的tx_buff_data 看起来像这样
tx_buff_data[0] have H'30,'0'
tx_buff_data[1] have H'30,'0'
tx_buff_data[2] have H'33,'3'
tx_buff_data[3] have H'31,'1'
tx_buff_data[4] have H'33,'3'
tx_buff_data[5] have H'32,'2'
tx_buff_data[6] have H'33,'3'
tx_buff_data[7] have H'33,'3'
【问题讨论】:
标签: c microcontroller low-level-code