The invention relates toa method for driving a light source, said method comprising the following steps: a.providing a code to be transmitted by the light source; b.converting the code into a sequence of different current levels, which current levels are maintained for a predetermined period of time; and c.providing the sequence of different current levels to the light source such that the light source emits light at different intensity levels, wherein driving the light source is carried out using a set-point update rate having a set-point update period, characterized in that transitions between the different current levels take more than one set-point update period.