A device comprising: a light-emitting element; a light-receiving element a driving device comprising: a setting section configured to set a bias current (ILD_th) of a light-emitting element and a target current (ILD_T) for setting output light from the light-emitting element to desired intensity, wherein setting section configured to set the bias current (ILD_th) of a light-emitting element is based on a result of detection of an offset light amount (PD_BG) when the light-emitting element does not emit light, the detection being performed by the light-receiving element that receives background light; and wherein setting section is configured to set the target current (ILD T) for setting output light from the light-emitting element higher than a linear segment in which emission intensity of the light-emitting element changes substantially linearly with respect to a driving current of the light-emitting element and is based on multiple second sample light amounts (PD_L2, PD_H2) detected by the light-receiving element, wherein the multiple second sample light amounts (PD L2, PD _H2) correspond to respectively emitted second light, emitted by the light-emitting element caused by multiple second driving currents (ILD L2, IDL_H2), thereby forming multiple second points (L2, H2) in a x-y plane, where the multiple second driving currents (ILD_L2, IDL_H2) form the x-coordinate and the multiple second sample light amounts (PD L2, PD _H2) form the y-coordinate, and wherein the target current (ILD_T) is configured to be calculated on a basis of a straight line between the multiple second points and a target light amount (PD T) detected by the light-receiving element; and an output controller configured to control an output of a driving current of the light-emitting element on a basis of at least one of the set bias current (ILD_th) or the set target current (ILD_T). a light-emitting element; a light-receiving element a driving device comprising: a setting section configured to set a bias current (ILD_th) of a light-emitting element and a target current (ILD_T) for setting output light from the light-emitting element to desired intensity, wherein setting section configured to set the bias current (ILD_th) of a light-emitting element is based on a result of detection of an offset light amount (PD_BG) when the light-emitting element does not emit light, the detection being performed by the light-receiving element that receives background light; and wherein setting section is configured to set the target current (ILD T) for setting output light from the light-emitting element higher than a linear segment in which emission intensity of the light-emitting element changes substantially linearly with respect to a driving current of the light-emitting element and is based on multiple second sample light amounts (PD_L2, PD_H2) detected by the light-receiving element, wherein the multiple second sample light amounts (PD L2, PD _H2) correspond to respectively emitted second light, emitted by the light-emitting element caused by multiple second driving currents (ILD L2, IDL_H2), thereby forming multiple second points (L2, H2) in a x-y plane, where the multiple second driving currents (ILD_L2, IDL_H2) form the x-coordinate and the multiple second sample light amounts (PD L2, PD _H2) form the y-coordinate, and wherein the target current (ILD_T) is configured to be calculated on a basis of a straight line between the multiple second points and a target light amount (PD T) detected by the light-receiving element; and an output controller configured to control an output of a driving current of the light-emitting element on a basis of at least one of the set bias current (ILD_th) or the set target current (ILD_T). a setting section configured to set a bias current (ILD_th) of a light-emitting element and a target current (ILD_T) for setting output light from the light-emitting element to desired intensity, wherein setting section configured to set the bias current (ILD_th) of a light-emitting element is based on a result of detection of an offset light amount (PD_BG) when the light-emitting element does not emit light, the detection being performed by the light-receiving element that receives background light; and wherein setting section is configured to set the target current (ILD T) for setting output light from the light-emitting element higher than a linear segment in which emission intensity of the light-emitting element changes substantially linearly with respect to a driving current of the light-emitting element and is based on multiple second sample light amounts (PD_L2, PD_H2) detected by the light-receiving element, wherein the multiple second sample light amounts (PD L2, PD _H2) correspond to respectively emitted second light, emitted by the light-emitting element caused by multiple second driving currents (ILD L2, IDL_H2), thereby forming multiple second points (L2, H2) in a x-y plane, where the multiple second driving currents (ILD_L2, IDL_H2) form the x-coordinate and the multiple second sample light amounts (PD L2, PD _H2) form the y-coordinate, and wherein the target current (ILD_T) is configured to be calculated on a basis of a straight line between the multiple second points and a target light amount (PD T) detected by the light-receiving element; and an output controller configured to control an output of a driving current of the light-emitting element on a basis of at least one of the set bias current (ILD_th) or the set target current (ILD_T).