... | ... | @@ -55,21 +55,13 @@ |
|
|
>
|
|
|
>#### Result!
|
|
|
>
|
|
|
|
|
|
private int read(String color){
|
|
|
|
|
|
int lightValue=0;
|
|
|
|
|
|
while (Button.ENTER.isDown());
|
|
|
|
|
|
LCD.clear();
|
|
|
LCD.drawString("Press ENTER", 0, 0);
|
|
|
LCD.drawString("to callibrate", 0, 1);
|
|
|
LCD.drawString(color, 0, 2);
|
|
|
while( !Button.ENTER.isPressed() ){
|
|
|
lightValue = ls.readValue();
|
|
|
LCD.drawInt(lightValue, 4, 10, 2);
|
|
|
LCD.refresh();
|
|
|
}
|
|
|
return lightValue;
|
|
|
} |
|
|
\ No newline at end of file |
|
|
>## Exercise 6: Color Sensor
|
|
|
>
|
|
|
>#### Task
|
|
|
>In the LEGO Mindstorms series there is a color sensor. Use the test program ColorSensorSensor.java to investigate the information that the class ColorSensor provide in Full mode.
|
|
|
>
|
|
|
>#### Plan
|
|
|
>To place the color sensor over black, white and green to figure out if the information provided can be used to distinguish the three colors.
|
|
|
>
|
|
|
>#### Result!
|
|
|
> |