How do I poll for sensors and their types?

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: imaqine, 99jonathan, roger

New User
Posts: 1
Joined: Fri Jun 08, 2007 2:43 pm
Location: Boston, MA

How do I poll for sensors and their types?

Postby ScottFrasso » Fri Jun 08, 2007 2:50 pm

I read the API and how it talks about polling for sensors, However I am not sure as to find their type.

An example of this would be if a user had a temperature sensor and a motor (or something) connected to the brick. When the user starts their program on the PC I would like to display which sensors are connected where, without the user physically checking the brick and entering that data into the PC.

Is this possible? If so how would you go about implementing this?

leJOS Team Member
Posts: 965
Joined: Mon Feb 05, 2007 1:27 pm

Postby lawrie » Mon Jun 11, 2007 7:46 pm

You can do this for I2C sensors as all the ones I have seen respond to standard messages asking for their type, manufacturer and version.

You cannot do it for Analog/Digital sensors like the Light/Touch and Sound sensor.

New User
Posts: 8
Joined: Mon Jun 25, 2007 10:44 pm

Postby Elnof » Mon Jun 25, 2007 10:46 pm

So there would be no way to do it? Dang...

Return to “NXJ Software”

Who is online

Users browsing this forum: No registered users and 2 guests