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.
AD模块采集到数据后,经过计算保存为float型变量(大于0),但是想通过串口发送的话,怎么强制转换为无符号整数呢?
比如 float a;
可以 (unsigned long)a 吗?
您好,
常用的方式是将float类型转化成字符型,然后发送,接收后再转换回来。
参考以下帖子:
https://e2e.ti.com/support/dsp/tms320c6000_high_performance_dsps/f/115/t/12204
C语言的知识 ()加类型强制转换即可