I am B.tech final year student working on a project of visitor counter and automation using 8051 uC. I am using two IR sensors on single gate to count both up and down and drive a relay. I am encountering difficulty in writing its code. Can you provide any help regarding code of this type of project?? I am using AT89C51 uC.