how to switch between to feedback signals to run in the code

I have a line sensor array and 2 sharp IR sensors and I want to make line sensor feedback going off when the sharp IR reads and vise versa
how I can do this.. I just need ideas as I had tried many things even interrupts and it doesn't work for me

thanks in advance

I'd start by providing concrete examples, like code and the actual outcome of running it - observations and debug print output; you know, the usual stuff.