Declaring digital signal

I posted code that did exactly what you wanted (from the test Arduino). When it sent G1 it turned the LED on and when it sent G28 it turned it off.

Now you want help with code that you haven't posted. Sorry that's impossible.