新手上路
- 积分
- 39
- 金钱
- 39
- 注册时间
- 2015-11-16
- 在线时间
- 1 小时
|

楼主 |
发表于 2016-5-24 15:37:47
|
显示全部楼层
本帖最后由 小新手~ 于 2016-5-24 15:39 编辑
void TIM3_IRQHandler(void)
{
if (TIM_GetITStatus(TIM3, TIM_IT_Update) != RESET)
TIM_ClearITPendingBit(TIM3, TIM_IT_Update );
if(flag == 0)
{
float temp2;
ds1302_data(read); //读取DS1302的时间
adcx=Get_Adc_Average(ADC_Channel_1,10);
LCD_ShowxNum(106,130,adcx,4,16,0);//显示ADC的值
temp=(float)adcx*(3.3/4096);
adcx=temp;
temp1 = (temp*(40000/21) - 2000/21);
LCD_ShowxNum(106,150,adcx,1,16,0);
LCD_ShowxNum(122,170,temp1,4,16,0);//显示气体浓度的值
temp-=adcx;
temp*=1000;
LCD_ShowxNum(122,150,temp,3,16,0X80);
adcx1 = (int)temp1;
temp2 = temp1 - adcx1;
temp2*=1000;
LCD_ShowxNum(162,170,temp2,3,16,0X80);//显示浓度小数部分
LED0=!LED0;
}
} |
|