So, basically what i'm trying to do is:
i let my NXT drive a parkour, and while he's doing that, he has to display the colors of a piece of paper (he drives over the paper) on the LCD.
The colors are red, green and blue.
The one thing that's not working is: reading or "seeing" the color and displaying them on screen.
the code i got now is :
ColorSensor cs = new ColorSensor(SensorPort.S1);
Color color = cs.getColor();
int groen = color.getGreen();
int rood = color.getRed();
int blauw = color.getBlue();
String text = "";
if (color.getColor() == groen){
text = "groen";
}
else if (color.getColor() == rood ){
text = "rood";
}
else if (color.getColor() == blauw ){
text = "blauw";
}
LCD.drawString("kleur is: " + text, 0, 0);
Thread.sleep(6000);