Hi,

I'm probably overlooking something very trivial, but even with the  
latest version of icommand pulled from the repository (0.5) I don't  
get any reliable readings from the ultrasonic sensor.

From:
            System.out.println("Sensor1 raw: " + Sensor.S1.readRawValue());
            System.out.println("Sensor1 norm: " +  
Sensor.S1.readNormalizedValue());
            Ultrasonic us = new Ultrasonic(Sensor.S1);
            System.out.println("Dist: " + us.getDistance() );
            System.out.println("ID: " + us.getId() );
            System.out.println("type: " + us.getSensorType() );
            System.out.println("scale fact: " + us.getScaleFactor() );

all I get is:
Sensor1 raw: 1023
Sensor1 norm: 1023
NXTCommand.LSGetStatus() error: Pending communication transaction in  
progress
No bytes to be read in I2CSensor.getData(). Returning 0.
Dist: 0
ID: 0
NXTCommand.LSGetStatus() error: Pending communication transaction in  
progress
type: r
NXTCommand.LSGetStatus() error: Pending communication transaction in  
progress
scale fact: 255

Note the weird response to getSensorType() . If I comment out  
getDistance(), I get the correct reply "Sonar" here. All this makes  
me suspect that something weird is going with lower level  
communication via bluetooth (not enough bytes read?). This is on Mac  
OS X, by the way.

Anyone else having problems with this? Help would be much  
appreciated, because at the moment getting readings from the  
ultrasonic sensor is actually what's most important for me.

Cheers,
David.


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Lejos-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lejos-discussion
  • ... David Schlangen
    • ... JAB , http : //www . juanantonio . info/p_research/robotics/robotics . htm
    • ... Brian Bagnall

Reply via email to