line sensor code