Loading ...
Sorry, an error occurred while loading the content.

Intellibrain bot and arduino comunication via I2C

Expand Messages
  • turkovic.dino
    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.
    Message 1 of 2 , Nov 8, 2010
    • 0 Attachment
      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 to get that code, but the examples itself 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);
      }
      }




      How to solve that problem?
    • ridgesoft
      It looks like an exception is occuring. If you do your testing with the robot connected to to the host computer you should get a full textual stack trace
      Message 2 of 2 , Nov 8, 2010
      • 0 Attachment
        It looks like an exception is occuring. If you do your testing with the robot connected to to the host computer you should get a full textual stack trace displayed in the RoboJDE run window. Be sure to build and download your program immediately prior to running so RoboJDE has all of the symbols needed to decode the stack trace. The stack trace output will show up in the Run window, which RoboJDE switches to automatically if you start the program from the RoboJDE GUI.

        Regards,

        RidgeSoft Support

        --- In intellibrain@yahoogroups.com, "turkovic.dino" <turkovic.dino@...> wrote:
        >
        > 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 to get that code, but the examples itself 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);
        > }
        > }
        >
        >
        >
        >
        > How to solve that problem?
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.