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.

AWR1843AOPEVM: Automated Parking Demo 的數值轉換

Part Number: AWR1843AOPEVM


各位前輩們好

請教一個可能是基本換算的問題,

我想在範例中對 objOut -> y 的值做對應旗標

objOut -> y 小於 2.5 將 R_alarm 至 1

objOut -> y 介於 2.5 ~ 4.5 將 Y_alarm 至 1

objOut -> y 等於 其它時 將 No_alarm 至 1

if((objOut->y < (float)(4.5)) && (objOut->y >= (float)(2.5))){
    
        Y_alarm =1;
        
}else if(objOut->y < (float)(2.5)){

        R_alarm =1;
        
}else{

        No_alarm =1;
        
}

但在無論怎麼執行,都只會進入 R_alarm =1的判斷式裡面。

Debug模式下可以看到 objOut -> y = 4.83...

以這值來看應該要讓 No_alarm =1,但是並沒有,

請問各位前輩,是否是我哪邊使用錯誤呢?

謝謝。