Is there a circuit that can control a switch with an on & off pattern of light hitting a LDR?

LDR can make good switches, but can a switch be made based on a pre-set on & off pattern? For example, If the light going to the LDR is disrupted (say 10 times), then and only then is the switch activated.
1 answer 1