Patent ID: 8797610

Claim:
A processing apparatus comprising: a photosensor including a light emitting element and a light receiving element, the light emitting element emitting light and the light receiving element receiving light emitted from the light emitting element and outputting a light receiving signal according to an amount of the received light; a processor; and a memory storing computer readable instructions, when executed by the processor, cause the processing apparatus to: control the light emitting element to emit light for a first light emission period, detect the light receiving signal output from the light receiving element at every interval during the first light emission period and obtain a first detection result in response to the detected light receiving signal, the interval being shorter than the first light emission period; make first determination by determining, based on the first detection result, whether the processing apparatus is in a condition in which the predetermined function is executable; control the light emitting element to emit light for a second light emission period that is shorter than the first light emission period; detect the light receiving signal output from the light receiving element after a waiting period passing from starting of the second light emission period and obtain a second detection result in response to the detected light receiving signal, the waiting period being shorter than the second light emission period and shorter than the interval; make second determination by determining, based on the second detection result, whether the processing apparatus is in a condition in which the predetermined function is executable; execute one of a first mode and a second mode that requires smaller consumption power than the first mode, and change an operation mode of the processing apparatus between the first mode and the second mode; make the second determination during execution of the second mode; in response to determination in the second determination in the second mode that the processing apparatus is in the condition in which the predetermined function is executable, keep the second mode and make the first determination; and in response to determination in the first determination in the second mode that processing apparatus is in the condition in which the predetermined function is executable, keep detecting the light receiving signal output from the light receiving element at the interval during the first light emission period and obtaining the first detection result in response to the detected light receiving signal, and change the operation mode from the second mode to the first mode.