If the LED is the source emitting coded light/UV, you can use a Light sensor to detect the transmitted light and then convert them to digital signals, then do the rest of the processng.
You can use the same signal which drive the LED to input to your glue-logic. So when the LED glows, you will get the same signal as input to your logic.