function to read line sensor