I have just wrote a program for my NXT with leJOS.
But while the NXT is fulfilling the Task, an error-sign pops up with:
Here my programm:
public class LightSensorEx1
NxtRobot robot = new NxtRobot();
LightSensor ls = new LightSensor(SensorPort.S1);
LightSensor rs = new LightSensor(SensorPort.S2);
Gear gear = new Gear();
if ( ls.getValue()>435)
public static void main(String args)
Its not the full programm just the basics.. .to show you my problem
Just give me a hint why there is an error sign ... because it is something like a homework
See the leJOS FAQ post:
viewtopic.php?t=236 For instructions on how to interpret the output from the default exception handler. This should help you narrow down what the exception is and which method is causing the problem...
It looks like you essentially have all of your program in the constructor of your class. This is probably not a good idea. There are various locks held during object construction that may be causing problems. I suggest that you move as much of the code as possible from the constructor into some other method (say a method called run or whatever) than change your main code to create an instance of your class and then call the run method