Hi all,

I'm trying to create some generic SensorManager class that at
initialisation will look for attached sensors and make them available via
a little HashTable with the type as key. (so other code can lookup what is
actually attached and if needed say: gimme the mike, please)
I got the whole idea because I just want to plug a sensor cable in a
random socket, without needing to think about were it "should" go.

Now, I found out that the documentation on iCommand is still very
rudimentary.
So I was wondering, since it's not really documented, what the int in
InputValues.sensorType would give me? I thought it was the key to my whole
plan, but... Is it me, or is it not functioning yet?
A little look in the source of iCommand didn't get my any further... it
looks like the returned ints (that should represent the type of sensor)
come pretty straight from the NXT brick.

While having 3 different sensors connected, the following code

InputValues iv;
Sensor sensor;

for (int portno = 0; portno < NUMBEROFPORTS; portno++) {
        iv = NXTCommand.getInputValues(portno);
        if (iv != null) {
                int type = iv.sensorType;
                log.out(Logger.DEBUG, "[EMAIL PROTECTED]" + portno + " is type 
'" + type +
"'.");
        }
}

gives as output in my logging:

SensorManager: [EMAIL PROTECTED] is type '0'.
SensorManager: [EMAIL PROTECTED] is type '0'.
SensorManager: [EMAIL PROTECTED] is type '0'.
SensorManager: [EMAIL PROTECTED] is type '0'.


Damn.

-- 

cheers,
Robbert


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Lejos-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lejos-discussion

Reply via email to