
#include <AT89X52.h> 

#define NUMPAT 8 
#define NUMIN 2 
double Input[NUMPAT+1][NUMIN+1]; 

void main (void) 
{
unsigned char i,j, k;

// Initialize the array here
k=1;
for (i=0; i<NUMPAT+1; i++)
	{
	for (j=0; j<NUMIN+1; j++)
		{
		Input[i][j]=k;
		k++;
		}
	}

// Write each element of 2 dimensional array onto port P1 of MCS51
for (i=0; i<NUMPAT+1; i++) 
	{ 
	for (j=0; j<NUMIN+1; j++) 
		P1= Input[i][j]; 
	} 
}