主题中讨论的其他器件:MSP432P401R
您好!
此函数使用 ADC 12位温度值进行调用。
该值是一个字(16位)并被转换为浮点值
根据其值使用方程式。
出于某种原因、当我尝试在中设置断点时
不同的条件、只允许第一个条件。
此外、该值(1426)绝对不大于3800 -
那么、为什么会调用此行呢?
是否存在特定的浮点值处理问题
有什么好处?
感谢您的任何帮助和想法。
梅希
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.
您好!
此函数使用 ADC 12位温度值进行调用。
该值是一个字(16位)并被转换为浮点值
根据其值使用方程式。
出于某种原因、当我尝试在中设置断点时
不同的条件、只允许第一个条件。
此外、该值(1426)绝对不大于3800 -
那么、为什么会调用此行呢?
是否存在特定的浮点值处理问题
有什么好处?
感谢您的任何帮助和想法。
梅希
float GetTemperature (word pvalue) { 浮点 gtemp; float valsq =(float)(pvalue * pvalue); 如果(pvalue > 3800) { // y =-0.1553x + 592.62 gtemp =(-0.1553 * pvalue)+ 592.62; } 否则(pvalue > 1500) { // y =-4E-06x2 - 0.0068x + 89.927 gtemp =-(0.000004 * valsq)-(0.0068 * pvalue)+ 89.927; } 其他 { // y = 4E-05x2 - 0.1244x + 175.7 gtemp =(0.00004 * valsq)-(0.1244 * pvalue)+ 175.7; } 返回 gtemp; }
我在发帖时遇到困难-我不明白为什么文本被解释为代码...
Hello,This function is called with the ADC 12-bit value of temperature.
The value is a
WORD
(16-bit) and is converted to a
float
value by
using
the equations according to its value.
For some reason, when I
try
to set a breakpoint within the different conditions, only the first one is allowed.
Also the value (1426) is definitely not greater than 3800 - so why does
this
row get called?
Is there something about dealing with
float
values that is specific with
this
MSP430?
Thanks
for
any help and ideas.
Mechi