/*水泵定时系统*/
#include "reg52.h"
#include "intrins.h"
#define uchar unsigned char
#define uint unsigned int
uchar a;
uchar temp;
//-----------------------------------------------
#define FOSC 12000000L
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端口为0,别的端口都是高电平不变,是程序没有朝下执行吗?
|