Method for sensing light being incident on an electronic device, the electronic device comprising a display and a light sensor arrangement mounted behind the display such as to receive incident light through the display, the method comprising the steps of: - repeatedly switching the display on and off depending on a modulation signal, wherein a sub-frame is defined by an on-state and a consecutive off-state of the display, and the modulation signal depends on at least one modulation parameter, wherein consecutive sub-frames are modulated using the at least one modulation parameter such that over one frame rate the display brightness has a same level, - in a first sub-frame, setting a display brightness to a first level depending on a first value of the at least one modulation parameter, - determining a first frame count by integrating the incident light by means of the light sensor arrangement during the first sub-frame, - in a second sub-frame, setting the display brightness to a second level depending on a second value of the at least one modulation parameter, - generating a second frame count by integrating the incident light by means of the light sensor arrangement during the second frame, and characterised in the further steps of: - determining an ambient light level depending on the first frame count and the second frame count, wherein for at least two sub-frames (SFR1, SFR2) the first frame count, denoted FC1, and the second frame count, denoted FC2, are expressed as follows: FC 1 = AL + DL 1 = AL + DL ⋅ 1 ± MI 1 / 2 ⋅ B FC 2 = AL + DL 2 = AL + DL ⋅ 1 ∓ MI 2 / 2 ⋅ B, wherein DL denotes a maximum brightness or defined brightness, DL1 and DL2 the first and second display level (DL1, DL2), MI1 and MI2 denote first and second modulation indeces, and B denotes a mean display brightness, and wherein - the at least two sub-frames (SFR1, SFR2) have same modulation indeces such that MI1 = MI2, such that the display level is determined as: DL = FC 2 − FC 1 MI 1 ⋅ B and the ambient light level AL is determined as: AL = FC 2 − DL ⋅ B. - repeatedly switching the display on and off depending on a modulation signal, wherein a sub-frame is defined by an on-state and a consecutive off-state of the display, and the modulation signal depends on at least one modulation parameter, wherein consecutive sub-frames are modulated using the at least one modulation parameter such that over one frame rate the display brightness has a same level, - in a first sub-frame, setting a display brightness to a first level depending on a first value of the at least one modulation parameter, - determining a first frame count by integrating the incident light by means of the light sensor arrangement during the first sub-frame, - in a second sub-frame, setting the display brightness to a second level depending on a second value of the at least one modulation parameter, - generating a second frame count by integrating the incident light by means of the light sensor arrangement during the second frame, and characterised in the further steps of: - determining an ambient light level depending on the first frame count and the second frame count, wherein for at least two sub-frames (SFR1, SFR2) the first frame count, denoted FC1, and the second frame count, denoted FC2, are expressed as follows: FC 1 = AL + DL 1 = AL + DL ⋅ 1 ± MI 1 / 2 ⋅ B FC 2 = AL + DL 2 = AL + DL ⋅ 1 ∓ MI 2 / 2 ⋅ B, wherein DL denotes a maximum brightness or defined brightness, DL1 and DL2 the first and second display level (DL1, DL2), MI1 and MI2 denote first and second modulation indeces, and B denotes a mean display brightness, and wherein - the at least two sub-frames (SFR1, SFR2) have same modulation indeces such that MI1 = MI2, such that the display level is determined as: DL = FC 2 − FC 1 MI 1 ⋅ B and the ambient light level AL is determined as: AL = FC 2 − DL ⋅ B. - determining an ambient light level depending on the first frame count and the second frame count, wherein for at least two sub-frames (SFR1, SFR2) the first frame count, denoted FC1, and the second frame count, denoted FC2, are expressed as follows: FC 1 = AL + DL 1 = AL + DL ⋅ 1 ± MI 1 / 2 ⋅ B FC 2 = AL + DL 2 = AL + DL ⋅ 1 ∓ MI 2 / 2 ⋅ B, wherein DL denotes a maximum brightness or defined brightness, DL1 and DL2 the first and second display level (DL1, DL2), MI1 and MI2 denote first and second modulation indeces, and B denotes a mean display brightness, and wherein - the at least two sub-frames (SFR1, SFR2) have same modulation indeces such that MI1 = MI2, such that the display level is determined as: DL = FC 2 − FC 1 MI 1 ⋅ B and the ambient light level AL is determined as: AL = FC 2 − DL ⋅ B.