rewrite of ambient light sensor