Today I'd updated my NXT firmware from Lejos 0.8 to 0.85. Well, since I did all I got problems.
First, the ultrasonic sensor did not respond. I could see in the forum they had a problem with the I2C port number 4, which did not respond with ultrasonic sensor. I changed the sensor of position and fixed
The next problem I've encountered and I have no solution is that the NXTCam camera does not respond well . The camera is connected to port 1, I tried to connect on different ports but still no answer.
I tried the following code to see the answer but always returns a value of 78:
- Code: Select all
import lejos.nxt.Button;
import lejos.nxt.LCD;
import lejos.nxt.SensorPort;
import lejos.nxt.Sound;
import lejos.nxt.addon.NXTCam;
public class Test {
private static NXTCam camara;
/**
* @param args
*/
public static void main(String[] args) {
camara = new NXTCam(SensorPort.S1);
camara.setTrackingMode(NXTCam.OBJECT_TRACKING);
camara.sortBy(NXTCam.SIZE);
while (!Button.ESCAPE.isPressed()) {
if (camara.getNumberOfObjects() > 0) {
LCD.drawString(" " + camara.getNumberOfObjects(), 1, 1);
} else {
LCD.drawString("NOTHING", 1, 1);
}
}
}
}
Of course in the previous version of NXJ the code works well, even with more complex programs. The problem is that I intended to reinstall the older version and does not seem possible for the plugin for eclipse, once updated, can not return to the previous version.
What is the problem so that the camera does not respond? Is it a bug?
I need urgent help, my final thesis project depends on this.
Thanks

