T1

งานที่  1

void main()
{
     unsigned char dice[]={0x08,0x22,0x2A,0x55,0x5D,0x77};
     unsigned char i;
     TRISC=0;
     TRISB=0x01;
     PORTC=0;
     while(1)
     {
            if(PORTB.F0==0)
            {
                    PORTC=dice[i];
                    delay_ms(3000);
                    PORTC=0;
            }
            i++;
            if(i>5)i=0;
     }

}

ความคิดเห็น

บทความที่ได้รับความนิยม