Color sensor problems;what went wrong?

hi-
our color sensors are having big problems; would anybody help me figure out what’s wrong?

oh, hi again.
just to clarify:

our light does not turn on
robot brain only sometimes recognizes the sensor
none of the color sensor functions work
the robot brain still thinks sensor is connected and shows error messages, prompting a memory reboot

and all the sensors and motors have the same firmware as a brain
im using robotc natural language

It sounds like an intermittent connection. I would check the wires and connectors first. Is there any dirt or bent wires inside the ports? Can you try another port or cable?

Please post your code. Remember to wrap it with [code] tags.

the wires are clear. i’ve checked all of them

[
task main()
{
resetTimer(T1);
setColorMode(portsevencolor,colorTypeGrayscale_Reflected);
sleep(1000);
repeatUntil(getTimerValue(T1)>360000){
arcadeControl(ChA,ChC);
float portsevencolorvalue;
portsevencolorvalue=getColorGrayscale(portsevencolor);
displayVariableValues(line1,portsevencolorvalue);
}

}
]

/* Some minor changes  */
task main()
{
float portsevencolorvalue;  /* declare variables first */
resetTimer(T1);
setColorMode(portsevencolor,colorTypeGrayscale_Reflected);
sleep(1000);
repeatUntil(getTimerValue(T1)>360000){
       arcadeControl(ChA,ChC);
       clearLCDLine(1);  /* erase what we wrote in the last pass */
       portsevencolorvalue=getColorGrayscale(portsevencolor);
      displayVariableValues(line1,portsevencolorvalue);
}

}

I’m assuming there is a pragma that assigns the color sensor to portsevencolor and the sensor is plugged into that port.

I never really add the declaration of a variable and my programs work normally, so i don’t think i need to add it.

and yes, i did assign the color sensor port and type(grayscale).
though im not sue i need to clear the line. it “automatically” overwrites it.

Sorry about the delay, but it’s been two weeks, did you get a fix for this?