Hi,
See this tutorial topic for a little more information:
http://lejos.sourceforge.net/nxt/nxj/tu ... rdware.htmThe type of the sensor is basically the overall use of the sensor port. For i2c devices this should be one of TYPE_LOWSPEED (for 5v sensors) or TYPE_LOWSPEED_9V (for 9V sensors). These names come from the Lego firmware.
The mode field specifies the i2c operating mode and should be one of LEGO_MODE, STANDARD_MODE, HIGH_SPEED, these values can also be combined with the value NO_RELEASE and ALWAYS_ACTIVE, but it is unlikely you will need either of these modifiers. They are defined here:
http://lejos.sourceforge.net/nxt/nxj/ap ... CPort.htmlSo in your case you probably want TYPE_LOWSPEED, for the type and HIGH_SPEED for the mode (yes that is a little confusing!).
However given that you can have multiple sensors attached to the same i2c port and the above attributes are really port based not sensor based, it arguably does not make sense to use the sensor constructor to set them. Basically the first active sensor for a port will set the operating mode by calling the i2cEnable method, this mode will stay in force until all of the sensors have released the port... So I tend to set things up so the actual sensor class uses LEGO_MODE (as this is compatible with all other Lego i2c sensors), then if I want to use a particular port in high speed mode I set the port mode explicitly by making a call to SensorPort.S1.i2cEnable(HIGH_SPEED) before creating the actual sensor classes attached to port 1. This will force all sensors attached to port 1 to use high speed mode. Note that if you connect multiple sensors to the same port they should all use the same voltage, and if you use high speed mode they must all be capable of operating in this mode (the Lego Ultrasonic sensor is not)...
Hope the above makes some sort of sense...
Andy
PS If your sensor does not work with the 0.9.0 release in high speed mode, it may be that it requires pulse stretching, I've just updated the firmware (after 0.9.0) to support this operating mode, you can grab a copy of the latest firmware file from here:
http://lejos.svn.sourceforge.net/viewvc ... n?view=log