Let's Make Robots!

Intellibrain problems

Hello everybody. I'm trying to get my intellibrain bot to comunicate with arduino via I2C, but I get some errors which I don't know how to debug. Google doesn't help at all. Here is what I get on my display when I turn on the program:
"Code: 20&97b6 
8d57 8d24 839d"
and after it shows that very shortly it turns the program off. It happens both when arduino is on and when it's off.
This is my code, I just changed some examples that came with the program, but the examples gave same or very simmilar errors too.

import com.ridgesoft.io.Display;
import com.ridgesoft.io.I2CMaster;
import com.ridgesoft.intellibrain.IntelliBrain;
import java.io.IOException;

public class IntelliBrainCompass{
private static final int COMPASS_ADDRESS = 0xc0;

public static void main(String args[]) {
try {
I2CMaster i2cMaster = IntelliBrain.getI2CMaster();

setMove(i2cMaster, COMPASS_ADDRESS, 600);
setMove(i2cMaster, COMPASS_ADDRESS, 600);
setMove(i2cMaster, COMPASS_ADDRESS, 1000);
Thread.sleep(1000);

}
catch (Throwable t) {
t.printStackTrace();
}
}

public static void setMove(I2CMaster i2cMaster,int adress, int position) throws IOException {
i2cMaster.transfer(adress, new byte[] {(byte)position,(byte)(position >> 8),(byte)(position >> 16),(byte)(position >> 24)},null);
}
}

 

 

Does anyone know what can I do to make the I2C comunication work?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I guess you are using a wrong I2C adress. Looking into the user guide shows:

The IntelliBrain virtual machine manages the
read write bit so you only need to be concerned with the value of the 7 address
bits when using the API. Consult the technical documentation for the I2C devices
you use for more information on their I2C addresses.

Try 0x60 instead of 0xC0. The lowest bit of the I2C adress acts as the read/write bit.