I am just learning c language. I have the basics down pat. But I am having trouble writing a C program fror an 8051 microcontroller. The idea of the program is to count the number of people entering and exiting our schools library. we are using photo eyes. That will be normally high, when someone breaks the beam they go low activating the program. The order in which the photo eyes break detirmens if the person is entering or leaving. I have the program idea in my head I just do not know enough about C to write it fully Here is what I have
Code:
#include <reg51.h>
#include <stdio.h>
#define LCDData P1
void main(void)
char X
char y
(
If(p3.0==0)
	if(p3.1==0)
	x++;

if(p3.1==0)
	if(p3.0==0)
	y++;
)
sbit en=p2^0;
display(void)
(
unsigned char message [ ]= "  "  this is where I want the number that X and Y are currently at
unsigned char z;
for(z=0;z<28;z++)
	{
	LCDData=message[z];
	En=1;
	En=0;
}
}
I know this is not complete, and the LCD display program is from a text book of mine. Any help would be greatly appreciated. I been stuck on the program for sometime.