#include<LPC214X.h>
unsigned char seg[10] = {0xC0, 0xF9, 0xA4, 0xB0, 0x99, 0x92, 0x82, 0xF8, 0x80, 0x90};

void delay(unsigned int x){
unsigned int i,j;
for(i = 0; i<x ; i++)
for(j = 0; j<1275 ; j++);
}

int main(void)
{

unsigned int count, i;
PINSEL0 = 0x0000000; //P0.0 -> P0.15 as GPIO
PINSEL2 = 0x00000000; //P1.16 -> P1.31 as GPIO
IODIR0 = 0x00000C00;
IODIR1 = 0x00FF0000;

while(1)
{

for(count = 0; count<100; count++)
{
for(i = 0; i<50; i++){

IOCLR0 = 0x00000C00;
IOCLR1 = 0x00FF0000;
IOSET1 = seg[count/10] << 16;
IOSET0 = 0X00000400;
delay(20);

IOCLR0 = 0x00000C00;
IOCLR1 = 0x00FF0000;
IOSET1 = seg[count%10] << 16;
IOSET0 = 0X00000800;
delay(20);

}
}
}
}
