ไมโครคอนโทรลเลอร์งาน 0-9

void main()
{
     char segment[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
     int i=0;
     TRISC=0;
     PORTC=segment[0];
     while(1)
     {
           delay_ms(500);
           i=i+1;
           if(i==10)i=0;
           PORTC=segment[i];
     }
}

ความคิดเห็น