code for phototransistor interrupt, perfect sync