java.lang.NoSuchMethodError

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

Moderators: 99jonathan, roger, imaqine

java.lang.NoSuchMethodError

Postby Yminus » Fri Mar 05, 2010 2:53 pm

The code below gives runtime error:
java.lang.NoSuchMethodError
in method:
Method 27: Class: TestClass Signature: <init>()V PC 4644 Signature id 2

But I can not figure out why - does anyone know?

Code: Select all
import lejos.nxt.Motor;


public interface TestIF {
   float WHEEL_DIAMETER = 56f;
   float WHEEL_BROADNESS = 26f;
   float TRACK_WIDTH = 120f;
   Motor LEFT_MOTOR = Motor.B;
   Motor RIGHT_MOTOR = Motor.A;
   boolean REVERSE = false;
}



Code: Select all
import lejos.nxt.Button;
import lejos.robotics.TachoMotor;
import lejos.robotics.navigation.TachoPilot;


public class TestClass extends TachoPilot implements TestIF {

   private TestClass(float wheelDiameter, float trackWidth,
         TachoMotor leftMotor, TachoMotor rightMotor) {
      super(wheelDiameter, trackWidth, leftMotor, rightMotor);
   }

   private TestClass(float wheelDiameter, float trackWidth,
         TachoMotor leftMotor, TachoMotor rightMotor, boolean reverse) {
      super(wheelDiameter, trackWidth, leftMotor, rightMotor, reverse);
   }

   private TestClass(float leftWheelDiameter, float rightWheelDiameter,
         float trackWidth, TachoMotor leftMotor, TachoMotor rightMotor,
         boolean reverse) {
      super(leftWheelDiameter, rightWheelDiameter, trackWidth, leftMotor,
            rightMotor, reverse);
   }

   public TestClass() {
      super(WHEEL_DIAMETER, TRACK_WIDTH, LEFT_MOTOR,
            RIGHT_MOTOR, REVERSE);
   }

   /**
    * @param args
    */
   public static void main(String[] args) {
      TestClass testPilot = new TestClass();
      Button.ESCAPE.waitForPressAndRelease();
   }
}


LCD output:
Code: Select all
Java Exception:
Class: 14
Method: 27
PC: 4649


Linker console output:
Code: Select all
leJOS NXJ> Linking...
Class 0: java.lang.Object
Class 1: java.lang.Throwable
Class 2: java.lang.Error
Class 3: java.lang.OutOfMemoryError
Class 4: boolean
Class 5: char
Class 6: float
Class 7: double
Class 8: byte
Class 9: short
Class 10: int
Class 11: long
Class 12: void
Class 13: [Ljava/lang/Object;
Class 14: java.lang.NoSuchMethodError
Class 15: java.lang.StackOverflowError
Class 16: java.lang.NullPointerException
Class 17: [Z
Class 18: [C
Class 19: [F
Class 20: [D
Class 21: [B
Class 22: [S
Class 23: [I
Class 24: [J
Class 25: [V
Class 26: java.lang.ClassCastException
Class 27: java.lang.ArithmeticException
Class 28: java.lang.ArrayIndexOutOfBoundsException
Class 29: java.lang.IllegalArgumentException
Class 30: java.lang.InterruptedException
Class 31: java.lang.IllegalStateException
Class 32: java.lang.IllegalMonitorStateException
Class 33: java.lang.ThreadDeath
Class 34: java.lang.ArrayStoreException
Class 35: java.lang.NegativeArraySizeException
Class 36: java.lang.Class
Class 37: java.lang.String
Class 38: java.lang.Cloneable
Class 39: java.lang.Thread
Class 40: lejos.nxt.Motor$Regulator
Class 41: TestClass
Class 42: lejos.nxt.Motor
Class 43: lejos.robotics.TachoMotor
Class 44: lejos.nxt.BasicMotor
Class 45: lejos.nxt.MotorPort
Class 46: java.lang.System
Class 47: java.lang.StringBuilder
Class 48: java.lang.Integer
Class 49: java.lang.RuntimeException
Class 50: java.lang.Exception
Class 51: java.lang.IndexOutOfBoundsException
Class 52: java.lang.StringIndexOutOfBoundsException
Class 53: java.lang.StringUtils
Class 54: java.lang.Runnable
Class 55: lejos.robotics.navigation.TachoPilot
Class 56: TestIF
Class 57: lejos.nxt.Button
Class 58: java.io.PrintStream
Class 59: lejos.nxt.LCDOutputStream
Class 60: java.lang.Number
Class 61: java.lang.NumberFormatException
Class 62: java.lang.Character
Class 63: java.lang.Math
Class 64: lejos.nxt.Battery
Class 65: lejos.util.Delay
Class 66: lejos.nxt.Sound
Class 67: lejos.nxt.SystemSettings
Class 68: [Llejos/nxt/Button;
Class 69: java.io.OutputStream
Class 70: java.io.IOException
Class 71: java.util.Random
Class 72: lejos.robotics.DCMotor
Class 73: lejos.nxt.Flash
Class 74: [Ljava/lang/String;
Class 75: lejos.robotics.Encoder
Class 76: lejos.nxt.BasicMotorPort
Class 77: lejos.nxt.FlashError
Class 78: lejos.nxt.NXT
Method 0: Class: java.lang.Object Signature: <init>()V PC 3400 Signature id 2
Method 1: Class: java.lang.Throwable Signature: <init>(Ljava/lang/String;)V PC 3401 Signature id 118
Method 2: Class: java.lang.Error Signature: <init>(Ljava/lang/String;)V PC 3411 Signature id 118
Method 3: Class: java.lang.IllegalArgumentException Signature: <init>(Ljava/lang/String;)V PC 3417 Signature id 118
Method 4: Class: java.lang.String Signature: <init>([CII)V PC 3423 Signature id 125
Method 5: Class: java.lang.String Signature: <init>([C)V PC 3451 Signature id 126
Method 6: Class: java.lang.String Signature: length()I PC 3460 Signature id 131
Method 7: Class: java.lang.String Signature: charAt(I)C PC 3466 Signature id 132
Method 8: Class: java.lang.String Signature: equals(Ljava/lang/Object;)Z PC 3491 Signature id 114
Method 9: Class: java.lang.Thread Signature: init(Ljava/lang/String;Ljava/lang/Runnable;)V PC 3563 Signature id 153
Method 10: Class: java.lang.Thread Signature: <init>()V PC 3606 Signature id 2
Method 11: Class: java.lang.Thread Signature: run()V PC 3618 Signature id 1
Method 12: Class: java.lang.Thread Signature: start()V Native id 9
Method 13: Class: java.lang.Thread Signature: yield()V Native id 10
Method 14: Class: java.lang.Thread Signature: sleep(J)V Native id 11
Method 15: Class: java.lang.Thread Signature: currentThread()Ljava/lang/Thread; Native id 12
Method 16: Class: java.lang.Thread Signature: getPriority()I Native id 13
Method 17: Class: java.lang.Thread Signature: setPriority(I)V Native id 14
Method 18: Class: java.lang.Thread Signature: interrupt()V Native id 15
Method 19: Class: java.lang.Thread Signature: isDaemon()Z Native id 19
Method 20: Class: java.lang.Thread Signature: setDaemon(Z)V Native id 18
Method 21: Class: lejos.nxt.Motor$Regulator Signature: <init>(Llejos/nxt/Motor;)V PC 3638 Signature id 389
Method 22: Class: lejos.nxt.Motor$Regulator Signature: calcPower(I)I PC 3673 Signature id 390
Method 23: Class: lejos.nxt.Motor$Regulator Signature: reset()V PC 3719 Signature id 228
Method 24: Class: lejos.nxt.Motor$Regulator Signature: run()V PC 3801 Signature id 1
Method 25: Class: lejos.nxt.Motor$Regulator Signature: stopAtLimit()V PC 4346 Signature id 391
Method 26: Class: lejos.nxt.Motor$Regulator Signature: angleAtStop()I PC 4582 Signature id 392
Method 27: Class: TestClass Signature: <init>()V PC 4644 Signature id 2
Method 28: Class: TestClass Signature: main([Ljava/lang/String;)V PC 4660 Signature id 0
Method 29: Class: lejos.nxt.Motor Signature: <init>(Llejos/nxt/TachoMotorPort;)V PC 4675 Signature id 312
Method 30: Class: lejos.nxt.Motor Signature: isMoving()Z PC 4799 Signature id 227
Method 31: Class: lejos.nxt.Motor Signature: regulateSpeed(Z)V PC 4828 Signature id 234
Method 32: Class: lejos.nxt.Motor Signature: smoothAcceleration(Z)V PC 4845 Signature id 311
Method 33: Class: lejos.nxt.Motor Signature: setSpeed(I)V PC 4856 Signature id 221
Method 34: Class: lejos.nxt.Motor Signature: setPower(I)V PC 4929 Signature id 314
Method 35: Class: lejos.nxt.Motor Signature: timedOut()V PC 4952 Signature id 316
Method 36: Class: lejos.nxt.Motor Signature: getTachoCount()I PC 4983 Signature id 318
Method 37: Class: lejos.nxt.Motor Signature: access$000(Llejos/nxt/Motor;)F PC 4993 Signature id 320
Method 38: Class: lejos.nxt.Motor Signature: access$100(Llejos/nxt/Motor;)I PC 4998 Signature id 321
Method 39: Class: lejos.nxt.Motor Signature: access$202(Llejos/nxt/Motor;Z)Z PC 5003 Signature id 322
Method 40: Class: lejos.nxt.Motor Signature: access$300(Llejos/nxt/Motor;)Z PC 5010 Signature id 323
Method 41: Class: lejos.nxt.Motor Signature: access$400(Llejos/nxt/Motor;)Z PC 5015 Signature id 324
Method 42: Class: lejos.nxt.Motor Signature: access$500(Llejos/nxt/Motor;)V PC 5020 Signature id 325
Method 43: Class: lejos.nxt.Motor Signature: access$200(Llejos/nxt/Motor;)Z PC 5025 Signature id 326
Method 44: Class: lejos.nxt.Motor Signature: access$600(Llejos/nxt/Motor;)I PC 5030 Signature id 327
Method 45: Class: lejos.nxt.Motor Signature: access$700(Llejos/nxt/Motor;)I PC 5035 Signature id 328
Method 46: Class: lejos.nxt.Motor Signature: access$800(Llejos/nxt/Motor;)Z PC 5040 Signature id 329
Method 47: Class: lejos.nxt.Motor Signature: access$900(Llejos/nxt/Motor;)B PC 5045 Signature id 330
Method 48: Class: lejos.nxt.Motor Signature: access$1000(Llejos/nxt/Motor;)I PC 5050 Signature id 331
Method 49: Class: lejos.nxt.Motor Signature: access$1100(Llejos/nxt/Motor;)I PC 5055 Signature id 332
Method 50: Class: lejos.nxt.Motor Signature: access$802(Llejos/nxt/Motor;Z)Z PC 5060 Signature id 333
Method 51: Class: lejos.nxt.Motor Signature: <clinit>()V PC 5067 Signature id 3
Method 52: Class: lejos.nxt.BasicMotor Signature: <init>()V PC 5107 Signature id 2
Method 53: Class: lejos.nxt.BasicMotor Signature: isMoving()Z PC 5143 Signature id 227
Method 54: Class: lejos.nxt.MotorPort Signature: <init>(I)V PC 5165 Signature id 119
Method 55: Class: lejos.nxt.MotorPort Signature: controlMotor(II)V PC 5180 Signature id 393
Method 56: Class: lejos.nxt.MotorPort Signature: controlMotorById(III)V Native id 49
Method 57: Class: lejos.nxt.MotorPort Signature: getTachoCount()I PC 5233 Signature id 318
Method 58: Class: lejos.nxt.MotorPort Signature: getTachoCountById(I)I Native id 48
Method 59: Class: lejos.nxt.MotorPort Signature: setPWMMode(I)V PC 5244 Signature id 394
Method 60: Class: lejos.nxt.MotorPort Signature: <clinit>()V PC 5250 Signature id 3
Method 61: Class: java.lang.System Signature: arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V Native id 24
Method 62: Class: java.lang.System Signature: currentTimeMillis()J Native id 22
Method 63: Class: java.lang.System Signature: <clinit>()V PC 5287 Signature id 3
Method 64: Class: java.lang.StringBuilder Signature: ensureCapacity(I)V PC 5322 Signature id 184
Method 65: Class: java.lang.StringBuilder Signature: <init>()V PC 5381 Signature id 2
Method 66: Class: java.lang.StringBuilder Signature: append(Ljava/lang/String;)Ljava/lang/StringBuilder; PC 5399 Signature id 185
Method 67: Class: java.lang.StringBuilder Signature: append(I)Ljava/lang/StringBuilder; PC 5405 Signature id 189
Method 68: Class: java.lang.StringBuilder Signature: appendInternal(Ljava/lang/String;)Ljava/lang/StringBuilder; PC 5443 Signature id 190
Method 69: Class: java.lang.StringBuilder Signature: toString()Ljava/lang/String; PC 5494 Signature id 117
Method 70: Class: java.lang.Integer Signature: parseInt(Ljava/lang/String;)I PC 5511 Signature id 193
Method 71: Class: java.lang.Integer Signature: parseInt(Ljava/lang/String;I)I PC 5518 Signature id 194
Method 72: Class: java.lang.Integer Signature: <clinit>()V PC 5673 Signature id 3
Method 73: Class: java.lang.RuntimeException Signature: <init>(Ljava/lang/String;)V PC 5678 Signature id 118
Method 74: Class: java.lang.Exception Signature: <init>(Ljava/lang/String;)V PC 5684 Signature id 118
Method 75: Class: java.lang.IndexOutOfBoundsException Signature: <init>(Ljava/lang/String;)V PC 5690 Signature id 118
Method 76: Class: java.lang.StringIndexOutOfBoundsException Signature: <init>(I)V PC 5696 Signature id 119
Method 77: Class: java.lang.StringUtils Signature: parseDigit(CI)I PC 5720 Signature id 205
Method 78: Class: java.lang.StringUtils Signature: throwNumberFormat(Ljava/lang/String;I)V PC 5742 Signature id 206
Method 79: Class: java.lang.StringUtils Signature: getIntChars([CIII)I PC 5778 Signature id 208
Method 80: Class: java.lang.StringUtils Signature: exactStringLength(II)I PC 5830 Signature id 210
Method 81: Class: lejos.robotics.navigation.TachoPilot Signature: <init>(FFLlejos/robotics/TachoMotor;Llejos/robotics/TachoMotor;Z)V PC 5853 Signature id 157
Method 82: Class: lejos.robotics.navigation.TachoPilot Signature: <init>(FFFLlejos/robotics/TachoMotor;Llejos/robotics/TachoMotor;Z)V PC 5866 Signature id 158
Method 83: Class: lejos.robotics.navigation.TachoPilot Signature: setSpeed(I)V PC 5961 Signature id 221
Method 84: Class: lejos.robotics.navigation.TachoPilot Signature: setSpeed(II)V PC 6009 Signature id 222
Method 85: Class: lejos.robotics.navigation.TachoPilot Signature: isMoving()Z PC 6098 Signature id 227
Method 86: Class: lejos.nxt.Button Signature: <init>(I)V PC 6141 Signature id 119
Method 87: Class: lejos.nxt.Button Signature: isPressed()Z PC 6151 Signature id 239
Method 88: Class: lejos.nxt.Button Signature: waitForPressAndRelease()V PC 6168 Signature id 240
Method 89: Class: lejos.nxt.Button Signature: getButtons()I Native id 47
Method 90: Class: lejos.nxt.Button Signature: readButtons()I PC 6198 Signature id 242
Method 91: Class: lejos.nxt.Button Signature: loadSettings()V PC 6242 Signature id 244
Method 92: Class: lejos.nxt.Button Signature: <clinit>()V PC 6316 Signature id 3
Method 93: Class: java.io.PrintStream Signature: <init>(Ljava/io/OutputStream;)V PC 6407 Signature id 268
Method 94: Class: lejos.nxt.LCDOutputStream Signature: <init>()V PC 6417 Signature id 2
Method 95: Class: java.lang.NumberFormatException Signature: <init>(Ljava/lang/String;)V PC 6427 Signature id 118
Method 96: Class: java.lang.Character Signature: digit(II)I PC 6433 Signature id 201
Method 97: Class: java.lang.Character Signature: forDigit(II)C PC 6511 Signature id 281
Method 98: Class: java.lang.Character Signature: <clinit>()V PC 6558 Signature id 3
Method 99: Class: java.lang.Math Signature: max(FF)F PC 6563 Signature id 285
Method 100: Class: java.lang.Math Signature: <clinit>()V PC 6575 Signature id 3
Method 101: Class: lejos.nxt.Battery Signature: getBatteryStatus()I Native id 46
Method 102: Class: lejos.nxt.Battery Signature: getVoltageMilliVolt()I PC 6649 Signature id 305
Method 103: Class: lejos.nxt.Battery Signature: getVoltage()F PC 6657 Signature id 306
Method 104: Class: lejos.util.Delay Signature: msDelay(J)V PC 6667 Signature id 334
Method 105: Class: lejos.nxt.Sound Signature: playFreq(III)V Native id 55
Method 106: Class: lejos.nxt.Sound Signature: playTone(III)V PC 6719 Signature id 342
Method 107: Class: lejos.nxt.Sound Signature: loadSettings()V PC 6745 Signature id 244
Method 108: Class: lejos.nxt.Sound Signature: <clinit>()V PC 6756 Signature id 3
Method 109: Class: lejos.nxt.SystemSettings Signature: getSlot(Ljava/lang/String;)I PC 6865 Signature id 347
Method 110: Class: lejos.nxt.SystemSettings Signature: setSlot(ILjava/lang/String;)V PC 6897 Signature id 348
Method 111: Class: lejos.nxt.SystemSettings Signature: getValue(I)Ljava/lang/String; PC 6955 Signature id 349
Method 112: Class: lejos.nxt.SystemSettings Signature: getStringSetting(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; PC 7027 Signature id 350
Method 113: Class: lejos.nxt.SystemSettings Signature: getIntSetting(Ljava/lang/String;I)I PC 7054 Signature id 351
Method 114: Class: lejos.nxt.SystemSettings Signature: setSetting(Ljava/lang/String;Ljava/lang/String;)V PC 7074 Signature id 352
Method 115: Class: lejos.nxt.SystemSettings Signature: <clinit>()V PC 7096 Signature id 3
Method 116: Class: java.io.OutputStream Signature: <init>()V PC 7208 Signature id 2
Method 117: Class: java.util.Random Signature: <init>(J)V PC 7213 Signature id 368
Method 118: Class: lejos.nxt.Flash Signature: flashReadPage([BI)I Native id 71
Method 119: Class: lejos.nxt.Flash Signature: flashWritePage([BI)I Native id 70
Method 120: Class: lejos.nxt.Flash Signature: readPage([BI)V PC 7229 Signature id 425
Method 121: Class: lejos.nxt.Flash Signature: writePage([BI)V PC 7248 Signature id 426
Method 122: Class: lejos.nxt.Flash Signature: <clinit>()V PC 7335 Signature id 3
Method 123: Class: lejos.nxt.FlashError Signature: <init>(Ljava/lang/String;)V PC 7348 Signature id 118
Method 124: Class: lejos.nxt.NXT Signature: getUserPages()I Native id 95
Master record    : 20 bytes.
Class records    : 79 (948 bytes).
Field records    : 82 (84 bytes).
Static fields    : 41 (84 bytes).
Static state     : 41 (204 bytes).
Constant records : 44 (176 bytes).
Constant values  : 44 (520 bytes).
Method records   : 125 (1500 bytes).
Exception records: 7 (56 bytes).
Interface maps   : 7 (8 bytes).
Code             : 107 (3956 bytes).
Total            : 7356 bytes.
Run time options : <NONE>
Constant loads   : 28N 9O 0W 28S
Static load/store: 12N 66O
Field  load/store: 136N 100O
leJOS NXJ> Uploading...
Found NXT: NXT 0016530A6F07
leJOS NXJ> Connected to NXT
leJOS NXJ> Upload successful in 1017 milliseconds
Yminus
Novice
 
Posts: 37
Joined: Sun Oct 19, 2008 7:05 pm

Postby gloomyandy » Fri Mar 05, 2010 3:47 pm

Hi,
You've found a bug in the 0.85 linker. Class initializers of Interface classes are incorrectly stripped out of the .nxj file. This has been fixed in the developer build, but you can't use that linker without moving to use a developer build (which may cause you other problems). The easy way to fix this for now would be to change you interface to be a regular class and change your test class to extend rather than implement it. You may also want to change the declaration of the vars in the TestIF to be static final as that is what they will be in an interface...

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3966
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Postby Yminus » Fri Mar 05, 2010 4:48 pm

Thanks - good to know that it is not my fault :-) ... this time ;-)

I am also waiting for proper I2C support to use 3 Mindsensors IR-Sensors on a port-splitter. Which according to this thread is also fixed in the developer version.

Can you tell when the next lejos version will be released?
Yminus
Novice
 
Posts: 37
Joined: Sun Oct 19, 2008 7:05 pm

Postby gloomyandy » Fri Mar 05, 2010 5:23 pm

I'm not sure when the next release will be. There are still a lot of changes being made to the robotics API.

I'm also not sure if your three sensors will work or not, since I don't have access to them or to a port splitter (I made my own for my tests and only tested using 2 sensors at a time). It is probably worth testing this without leJOS if possible. Have you been able to change the address of two of the sensors (you will need to do this before you can use them). I would suggest that you use the programs provided by mindsensors to do this. Yoy should then be able to test the use of the three sensors using the Lego software.

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3966
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Postby Yminus » Mon Mar 08, 2010 2:26 pm

gloomyandy wrote:It is probably worth testing this without leJOS if possible. Have you been able to change the address of two of the sensors (you will need to do this before you can use them). I would suggest that you use the programs provided by mindsensors to do this. Yoy should then be able to test the use of the three sensors using the Lego software.


I did as suggested. I can use all of the 3 sensors on a port splitter with nxt-g but only Dist-Nx-S and Dist-Nx-M with lejos.
I tried Dist-Nx-L with address set to 4, 6 and 8 (3, 5, 7 for leJOS) with and without port splitter but none of those worked. I set the address back to 2 and it worked again with leJOS.
Yminus
Novice
 
Posts: 37
Joined: Sun Oct 19, 2008 7:05 pm

Postby gloomyandy » Mon Mar 08, 2010 2:38 pm

So are you saying that one of your sensors does not work with a changed address even when used just on its own (no port splitter no other sensors)? What leJOS class are you using to access them? Are you sure that the address change actually worked and that the sensor was not still on address 2/1? What versions of the sensors do you have (you should be able to display the version string). Perhaps the -L sensor is older?

Other than the above I have no idea what is going on and without access to that particular sensor I probably have no way to find out...

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3966
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Postby Yminus » Tue Mar 09, 2010 3:05 pm

gloomyandy wrote:So are you saying that one of your sensors does not work with a changed address even when used just on its own (no port splitter no other sensors)?

Yes. And meanwhile I tested it with another Dist-Nx-L Sensor with same results.

gloomyandy wrote:What leJOS class are you using to access them?

OpticalDistanceSensor

gloomyandy wrote:Are you sure that the address change actually worked and that the sensor was not still on address 2/1?

Yes I tested it on nxt-g with mindsensors DIST-Nx-sample and changeaddr

gloomyandy wrote:What versions of the sensors do you have (you should be able to display the version string). Perhaps the -L sensor is older?

DIST-NxS: V2.00
DIST-NxM: V2.10
DIST-NxL: V2.00

The version of L is the same as S. And changing the address of S does not work, too (I did not test this before).
Yminus
Novice
 
Posts: 37
Joined: Sun Oct 19, 2008 7:05 pm

Postby Yminus » Tue Mar 09, 2010 4:41 pm

OK, today the M Sensor stopped working on other addresses than 2 with lejos?!? It still works as expected with nxt-g.

So we better forget port splitting and work with 2 connected NXT instead.
Yminus
Novice
 
Posts: 37
Joined: Sun Oct 19, 2008 7:05 pm

Postby burti » Tue Mar 09, 2010 8:01 pm

Yminus wrote:OK, today the M Sensor stopped working on other addresses than 2 with lejos?!? It still works as expected with nxt-g.

have you tried to call powerOff() and powerOn() on those sensors to reset them?
Sometimes that helps. :idea:
burti
Novice
 
Posts: 61
Joined: Thu Jun 25, 2009 11:41 pm

Postby Yminus » Wed Mar 10, 2010 4:12 pm

burti wrote:have you tried to call powerOff() and powerOn() on those sensors to reset them?

Thanks for the tip but it did not help.
Yminus
Novice
 
Posts: 37
Joined: Sun Oct 19, 2008 7:05 pm

Postby Yminus » Wed Mar 10, 2010 5:33 pm

OK, I solved it! This time it was my fault :oops:
I misinterpreted the address specification of leJOS. I thought leJOSaddresses are
leJOSaddress = LEGOaddress - 1
(odd instead of even) but it's
leJOSaddress = LEGOaddress / 2
Now everything works as expected with all 3 kind of sensors with and without port splitter.

Sorry for the false alarm.
Yminus
Novice
 
Posts: 37
Joined: Sun Oct 19, 2008 7:05 pm

Postby gloomyandy » Thu Mar 11, 2010 10:14 am

Hi,
Thanks for letting us know what was going on. just to let you know, in the next release 9and the current dev builds), we have changed the way we do i2c addressing to be in line with the rest of the Lego world. The i2c address thing was/is pretty confusing and hopefully we can make things a little less so in the future...

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3966
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 4 guests

more stuff