This is where you talk about the NXJ software itself, installation issues, and programming talk.
Moderators: roger, imaqine, 99jonathan
- New User
- Posts: 12
- Joined: Sun Oct 28, 2007 7:36 pm
It appears that the time it takes to get a ultrasonic sensor reading with icommand takes 100-200ms. Is that normal? Here's the code.
time = System.currentTimeMillis();
reading = sensor.getDistance();
logger.info("time "+ (System.currentTimeMillis()-time));
Is this due to the communication latency from the PC to the NXT?
- Site Admin
- Posts: 392
- Joined: Fri Aug 04, 2006 4:03 pm
Yes, there's another workaround by using this command after open():
I'll probably take a look at the UltrasonicSensor code soon and make it work more like the leJOS NXJ code (for upcoming 0.5 version) which has the timing issue worked out.
Return to “NXJ Software”
Who is online
Users browsing this forum: Baidu [Spider], Yahoo [Bot] and 5 guests