I have built a project that uses the baby-O to detect and control the float level in a gas tank and send the proper voltage to the gas gauge to cause it to display the proper fuel level. To allow a user to set up the parameters of the program I have a separate unit that can be plugged into the main unit (the main unit contains the baby-O). This separate unit has an LCD and 3 buttons for the configuration process. When the gas gauge indicates a near empty tank the main unit uses PC4 to light up a yellow LED warning light.
When the main unit is functioning it sends periodic readings to the LCD. When the separate LCD unit is plugged in the readings appear on the LCD. I found that the warning light functions as it should when the separate LCD unit is plugged in but, if it is not plugged in, the warning light may go on and not turn off no matter what the fuel level is or it may not light up when the fuel level goes from being OK to being near empty. If I comment out the LCD print commands and unplug the LCD unit, the warning light works as it should. if I could detect the presence of the LCD I could skip the LCD print code and potentially fix the problem.
Why is this happening and how might I fix it?