added light sensor reading function