Mình đang mò mẫm tự học lập trình C cho VDK 8051, thực hành viết đoạn code led sáng dần từ P1.0 - P1.7, nhưng mà không hiểu sao mô phỏng trên proteus nó chỉ nhấp nháy ở mỗi chân P1.0 , sửa mãi không xong
. Mọi người xem giúp mình, mình cảm ơn nhìu 
#include <REGX52.H>
void delay(int t)
{
int j;
for(j=0;j<t;j++);
}
void main(void)
{
unsigned char i;
P1=0x00;
while(1)
{
P1=0x00;
delay(5000);
for(i=0;i<8;i++);
{
P1=(P1<<1)|0x01;
delay(5000);
}
}
}


#include <REGX52.H>
void delay(int t)
{
int j;
for(j=0;j<t;j++);
}
void main(void)
{
unsigned char i;
P1=0x00;
while(1)
{
P1=0x00;
delay(5000);
for(i=0;i<8;i++);
{
P1=(P1<<1)|0x01;
delay(5000);
}
}
}
Comment