初级会员

- 积分
- 93
- 金钱
- 93
- 注册时间
- 2013-6-20
- 在线时间
- 0 小时
|

楼主 |
发表于 2013-7-25 19:21:12
|
显示全部楼层
回复【2楼】LTKKS:
---------------------------------
这是我的计算部分
TIM_Cmd(TIM2, DISABLE); //关闭时钟
Converted_Flag=0;
for(t=0;t<N;t++)
{
temp = temp + ADC_Value[t];
}
temp = temp /N;
a=(float)temp*(3.3/4096); //2的12次=4096
temp=a; //整数
a-=temp;
a*=100; //小数部分
table[0]=temp+0x30;
table[1]='.';
table[2]=(u8)a/10+0x30;
table[3]=(u8)a%10+0x30;
table[4]='V';
table[5]='\r';
table[6]='\n';
temp=0;
ADC_num=0;
Uart1_PutStr(table,10);
// test ();
TIM_Cmd(TIM2, ENABLE);> |
|