Sketch to drive 4x IR LED/phototransistor pairs used as train occupancy detectors