# include
# define uint unsigned int
sbit BOT=P1^0; //设置BOT,用于设置输出脉冲命令
sbit PLUSE=P1^1;
void delay(uint m) //延时程序,用于设置脉宽
{
m--;
}
void main()
{
while(1)
{
if (BOT==0)
{
PLUSE=0;
delay(100); //调整脉宽宽度
PLUSE=1;
delay(100);
PLUSE=0;
delay(100);
}
}
}
sbit IN =P1^0;
sbit OUT =P1^1;
void main (void)
{
int i;
IN=1;
OUT=0;
while(1)
{
if(0==IN)
{
OUT=1;
for(i=0;i<10000;i++){ }
OUT=0;
}
}
}
我也求高手