executed. Accordingly the variable photogate is 1 when there is an object in the photogate, between the LED and the phototransistor, blocking the infrared light. With no object in the photogate, the variable photogate is 0. For our picket fence experiment we want to capture and record the time when the infrared light is blocked the very first time by each of the 6 x 4 Lego plates. The program uses another variable, named trigger, to identify the exact moment when the variable photogate changes from 0 to 1. With no object in the photogate, the variable trigger is set to 1 and the system is ready to capture the arrival of an object. The very first time an object is detected, the variable trigger is set to 0, thus preventing the recording of all of the later times when the object is still in the photogate. After the object gets out of the photogate, the variable trigger is again set to 1, and the system is ready to capture the arrival of the next 6 x 4 Lego plate.