code for light sensor