the following steps are performed in connection with a photodiode circuit : a ) resetting the photodiode circuit ; b ) determining when a photodiode voltage changes in response to illumination to reach a threshold ; and c ) updating a counter in response to the determination in step b ). the steps a ) to c ) are repeated until an end of a measurement period is reached . the value of the counter at the end of the measurement period is then output to indicate an intensity of the illumination .