摘要 |
<p>PURPOSE:To reduce consumption of power by measuring a time required until the ON state of a light-sensing element is detected after a light-emitting element is driven, and by driving the light-emitting element thereafter in accordance with a measured value thus obtained. CONSTITUTION:In the course of an initializing process executed periodically, CPU 1 outputs a signal of high level to an output port PO thereof at a time (t), to drive a light-emitting element 4, and receives as an input the ON state of a light-sensing element 5 at an input port PI actually through a light-sensing circuit 3, and thereby it is detected that the element 5 turns ON at the time (t) and that the input level thereof is put in a state of low level. While storing a time difference t2 - t1 between the drive of the element 4 and the ON state of the element 5, the CPU 1 drives the element 4 thereafter on the basis of this measured time difference t2 - t1. In other words, the time for driving the element 4 is measured actually in the initializing process and the element 4 is driven on the basis of this measured time for driving, so as to detect whether an object passes or not. As the result, the time for driving can be shortened and, accordingly, consumption of power can be reduced to be small.</p> |