参考:这样修改一下怎样?
unsigned char code addr_chan[ ]={0xfc,0xfd,0xfe,0xff}; /*四个通道地址*/
unsigned int xdata result[4]; /*采样值缓冲区*/sbit
sbit convert=P1^2;
sbit BUSY=P1^3;
void convertchanl1( )
{
int i;
for (i=0;i<4;i++)
{
P1=addr_chan[i]&0xff; /*建立通道地址*/
;
convert=0;
convert=1;
while(busy==1);
result[i] = (resulthigh<<8)+resultlow; /*循环四次,完成四个通道采样*/
}
}
如果你原来的程序可用的话,这样修改一下怎样?
发表时间:2003年2月10日11:37:00