Right, now you can see the code:
Code: C
//time waste function, to wait time given sleeptime[ms]
void sleep(int sleeptime)
{
int i,j;
for (i = 0;i < sleeptime; i++)
{
for (j = 0;j < 20000; j++)
}
}
int main( void) {
int a,row;
unsigned char k;
PB.DDR = 0xff;
P4.DDR = 0xff;
while (1){
a = 0x80;
for (row = 0;row < 8;row ++){
P4.DR.BYTE = a;
PB.DR.BYTE = ~(ascii['A'][row]);
sleep(1);
a >>=1;
}
return 0;
}
There's the code to design for the KID (8*8)
Seem very easy, but it's more difficult. because you should understand about Interupt.