/*水泵定时系统*/
#include "reg52.h"
#include "intrins.h"
#define uchar unsigned char
#define uint unsigned int
uchar a;
uchar temp;
//-----------------------------------------------
void delay_fen(void)
//延时一分钟
{
unsigned char j;
unsigned int i;
for(i=0;i<60000;i++)
{
for(j=0;j<200;j++);
for(j=0;j<102;j++);
}
}
main()
{
while(1)
{
P1=temp=0xfe;
delay_fen();
for(a=0;a<6,a++;)
//P10至P15端口依次输出低电平,时间一分钟
{
temp<<=1;
temp|=0x01;
P1=temp;
delay_fen();
}
}
}
万用表检测,一直是P10口低电平,别的口电平不变,难道程序不会执行? |