#include <reg51.h>
#include <intrins.h>
sfr P0 =0x80;
sbit P0_0=P0^0;
sbit P0_7=0x80^7;//0x80=P0
sbit P0_1=0X81;void delay1ms (unsigned int n)
{
int x,y;
for(x=n;x>0;x--)
{
for(y=123;y>0;y--);
}
}
void mian()
{
unsigned char b;
do{
delay1ms(1000);
P0_0=0;
delay1ms(1000);
P0_7=0;
for(b=0;b<255;b++)
{
delay1ms(1000);
P0=b;
}
P0=0xff;
for(b=0;b<255;b++)
delay1ms(1000);
P0_1=0;
delay1ms(1000);
P0_1=1;
}while(1);
}
#include <intrins.h>
sfr P0 =0x80;
sbit P0_0=P0^0;
sbit P0_7=0x80^7;//0x80=P0
sbit P0_1=0X81;void delay1ms (unsigned int n)
{
int x,y;
for(x=n;x>0;x--)
{
for(y=123;y>0;y--);
}
}
void mian()
{
unsigned char b;
do{
delay1ms(1000);
P0_0=0;
delay1ms(1000);
P0_7=0;
for(b=0;b<255;b++)
{
delay1ms(1000);
P0=b;
}
P0=0xff;
for(b=0;b<255;b++)
delay1ms(1000);
P0_1=0;
delay1ms(1000);
P0_1=1;
}while(1);
}