by lawrie » Fri Oct 26, 2007 10:03 am
I am not a hardware expert, but it is my understanding that the way the pins are used is different for different sensors. For Analog/Digital sensors like the Touch, Sound and Light sensors it is the digital version of this voltage reading between pins 1 and 2 that is returned as the raw sensor reading. Pins 1 and 2 are connected to the separate AVR chip which reads these values and then communicates with the main ARM chip over an I2C link and sends a packet of data for each reading. leJOS, like the standard Lego firmware, can only return what is in this packet.
To get the raw A/D value from any sensor that supports it you can use SensorPort.readRawValue, e.g:
int val = SensorPort.S1.readRawValue();