#include<reg52.h>
#define uint unsigned int
#define uchar unsigned char
void delay(uint z)
{
uint x,y;
for(x=z;x>0;x--)
for(y=114;y>0;y--);
}
sbit LED1=P2^0;
sbit out=P3^2;
void main()
{
out==1;
while(1)
{
if(out==1)
{
LED1=0;
}
else
{
delay(200);
LED1=1;
}
}
}
红外out口接P3^2,为什么通电后led一直自己亮灭,急急急
|