標(biāo)題:
STM32F013單片機(jī)程序中關(guān)于變量的問題
[打印本頁]
作者:
lvwenqiang1988
時(shí)間:
2016-4-26 11:33
標(biāo)題:
STM32F013單片機(jī)程序中關(guān)于變量的問題
for(k=0;k<100;k++)
{
GPIO_ResetBits(GPIOA,GPIO_Pin_9); //給讀時(shí)鐘 上升沿讀數(shù)據(jù)
GPIO_SetBits(GPIOA,GPIO_Pin_9);
ReadValue[k]=(GPIO_ReadInputData(GPIOC)&0x03ff); //讀FIFO的數(shù)據(jù)
if(ReadValue[k]>512)
{
max_temp[i]+=(ReadValue[k]-512);
count+=1;
}
}
我定義ReadValue[k]為 u16類型 max_temp[i]為u32類型 到后面我程序用到max_temp[i]時(shí) 數(shù)據(jù)總會(huì)出問題,在此請教一下各路高手哦,分析一下可能的原因
歡迎光臨 (http://www.torrancerestoration.com/bbs/)
Powered by Discuz! X3.1