Hey,
I am making a segway,everything went fine and all but then i got to program the light sensor.
Now here the light sensor doesn't give light it doesn't output anything except the highest value possible.
help?
Moderators: roger, 99jonathan, imaqine
import lejos.nxt.*;
public class LightTest {
public static void main(String[] args) throws Exception {
LightSensor light = new LightSensor(SensorPort.S1);
while (true) {
LCD.drawInt(light.getLightValue(), 4, 0, 0);
LCD.drawInt(light.getNormalizedLightValue(), 4, 0, 1);
LCD.drawInt(SensorPort.S1.readRawValue(), 4, 0, 2);
LCD.drawInt(SensorPort.S1.readValue(), 4, 0, 3);
}
}
} Users browsing this forum: No registered users and 0 guests