No commit message authored by Nikolaj Cilleborg Haulrik's avatar Nikolaj Cilleborg Haulrik
No commit message
...@@ -55,21 +55,13 @@ ...@@ -55,21 +55,13 @@
> >
>#### Result! >#### Result!
> >
>## Exercise 6: Color Sensor
private int read(String color){ >
>#### Task
int lightValue=0; >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.
>
while (Button.ENTER.isDown()); >#### 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.
LCD.clear(); >
LCD.drawString("Press ENTER", 0, 0); >#### Result!
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