icc avr中的char *ftoa(float f, int *status)函数如何使用?
我想把由AD转化得来的温度值显示在18b20上,但要求只截取小数点后两位,用上述函数怎么完成;能不能有个例程?或者有其他的方法完成,我发现如果用传统的方法:就是把每位的数字分开显示有点麻烦;请马老师指教! 传统的方法你掌握了吗?先掌握传统的方法,把基础打好. 改错:把由AD转化得来的温度值显示在lcd上不好意思第一次发帖!
如果是将每位数字分开显示的话已经可以显示的:用显示几位就乘以10的几次幂,在将其一位一位显示出来 char *ftoa(float f, int *status)
converts a floating point number to the ASCII representation. It returns a static buffer of approximately 15 chars. If the input is out of range, *status is set to the constant _FTOA_TOO_LARGE, or _FTOA_TOO_SMALL, defined in stdlib.h, and 0 is returned. Otherwise, *status is set to 0 and the char buffer is returned. This version of the ftoa is fast but cannot handle values outside of the range listed. Please contact us if you need a (much) larger version that handles greater ranges.
页:
[1]