new code for interfacing the light sensor