This article will provide you with some knowledge on the photo resistor, which is used by analog comparator on an ATmega168.
Previously analog comparator edge used interrupts to monitor the photo resistor. However, many bugs have been detected while working with it so now the input capture circuit has been incorporated.
The clock and the data signals have been rolled into one in the project and each bit has two equal parts and is called as T. Transition between the two frames of IS and bits are just used for recording the time.
The sender sends out a bunch of signals and the receiver waits for those signals till the 2T has passed between the edges. This process is used to synchronize the sender and receiver and to achieve more efficiency. In order to avoid synchronization in the middle of a message, a preamble of 0×0F has used.