Results 1 to 4 of 4

Thread: Arbotix & I2C

  1. #1
    Join Date
    Feb 2010
    Location
    Northern, VA (Fredericksburg)
    Posts
    104
    Images
    10
    Rep Power
    38

    Question Arbotix & I2C

    Does anyone know how to address the I2C lines on the Arbotix? I have seen something like this (code below) online, but I don't know how this "knows" where to send/recieve I2C data... The arbotix manual isn't super clear on I2C communication and I haven't been able to find the much in the way of example code. I'm using the RM-G146 and am fairly confident I have it wired correctly.

    Code:
    #include "Wire.h"     
    #define gyro_addr 0x68 
    #define magne_addr 0x30 
    #define acce_addr 0x18   
     
     
    void setup()
    {
      Wire.begin();     
      Serial.begin(9600);
    }
    
      void getdata_acce(byte *a, byte *b)
      {
       
        Wire.beginTransmission(acce_addr);
        Wire.send(0);   
        Wire.endTransmission();
        
       
        Wire.requestFrom(acce_addr, 2); 
        *a = Wire.receive(); 
        *b = Wire.receive(); 
      }
    
    void loop()
    {
     byte aa, bb;    //variables for storage
     
     getdata_gyro();
     getdata_acce(&aa, &bb); 
     getdata_magne();
     
     
     Serial.print('a= ');
     delay(300);
     Serial.print(aa, HEX);    //prints the value of aa
     delay(300);
     Serial.print('\n b=');
     delay(300);
     Serial.print(bb, HEX);    //prints the value of bb
     delay(300);
    }
    I also read that the address listed are wrong, 8 bit vs. 7 bit, I'm not sure how to tell if thats correct or not, but I assume I can figure that out once I get the communication address/s figured out.

    Thanks!


    Cheers,
    Scott

  2. #2

    Re: Arbotix & I2C

    The I2C bus is available on two specific pins: PC4 and PC5 on the Atmega328 (which maps to A4 and A5 in the Arduino IDE)
    You can't move it anywhere else: you have to use those exact pins.

  3. #3
    Join Date
    Feb 2010
    Location
    Northern, VA (Fredericksburg)
    Posts
    104
    Images
    10
    Rep Power
    38

    Re: Arbotix & I2C

    I used the schematic on the last page of the arbotix manual to figure out the pin outs, was not what I expected from reading the description, but it is there if you look for it on the schematic. I was able to receive data of some kind using the above code, it was just random numbers on the serial read monitor, but it was a start :*)

    Cheers,
    Scott

  4. #4
    Join Date
    Feb 2010
    Location
    Northern, VA (Fredericksburg)
    Posts
    104
    Images
    10
    Rep Power
    38

    Cool Re: Arbotix & I2C

    I found a significant improvement for information on this product when I did a search for the base components on google, basiclly search for "LSM303DLH" and the "MPU-3050" and found user manuals, spesifications and some code. I haven't had time yet to dig into these but I believe this should open up this chip quite a bit.

    Trossen should post links to these documents from the product page or possibly just host them, I think it would clear up a lot of questions folks might have on this chip.

    Cheers,
    Scott

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Arbotix 0.5.0
    By lnxfergy in forum ROS - Robot Operating System
    Replies: 17
    Last Post: 08-13-2012, 11:51 AM
  2. quadrocopter w/ROS Arbotix
    By ahack3r in forum ROS - Robot Operating System
    Replies: 5
    Last Post: 11-07-2010, 11:54 PM
  3. Question(s) arbotix bootloader
    By drdiode in forum Arbotix, Microcontrollers, Arduino
    Replies: 9
    Last Post: 10-25-2010, 01:07 PM
  4. Question(s) Arbotix Commander
    By elaughlin in forum Robotics General Discussion
    Replies: 2
    Last Post: 10-24-2010, 01:33 AM
  5. News/Announcement arbotiX Robocontroller Now Available!
    By DresnerRobotics in forum Arbotix, Microcontrollers, Arduino
    Replies: 16
    Last Post: 10-14-2009, 04:22 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •