Arduino MPU adresses on UDO

Discussion in 'Arduino IDE' started by Berk, Mar 4, 2017.

  1. Berk

    Berk New Member

    Joined:
    Nov 22, 2016
    Messages:
    17
    Likes Received:
    5
    Hello everybody,

    I have a problem with MPU_6050 adresses on UDO. I can take angles with easily from device. But, I need to manage frequency of sampling in order to set some variables. Arudiono-IDE gives the error which is belowing:

    Code:
     TWBR = ((F_CPU / 400000L) - 16) / 2; // Set I2C frequency to 400kHz
    How can I fix this problem?

    Thank you.
     
  2. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    I suppose from your other messages you use the Udoo Neo. This device uses a different I2C wire library than an Arduino Uno. The variable TWBR is not a valid variable in this.
    The wire library used on the Neo can be found here https://github.com/UDOOboard/arduino-board-package/tree/boardmanager/udoo/solox/libraries/Wire and in your Arduino IDE
    I took a short look and found the TWI_CLOCK variable but I don't know what valid values are other than the given. Perhaps look into the CPP if there is more information. Also look into the freescale reference manual http://cache.nxp.com/files/32bit/do...ORMAT=pdf&WT_ASSET=Documentation&fileExt=.pdf
     
    Berk likes this.
  3. Berk

    Berk New Member

    Joined:
    Nov 22, 2016
    Messages:
    17
    Likes Received:
    5
    Thank you so much waltervl for you have interested in. I have predicted like this problem. This device so unique :cool:
    I will look wire libraries and freescale reference manual. Also, I will try that TWI_CLOCK command in order to get sampling frequency..
     
  4. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    I saw later there is also a set clock function in the udoo neo wire library so perhaps that will do the trick.
     
  5. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    By the way, are you using an external sensor or the internal 9 axis sensors of the Neo (full)
     
  6. Berk

    Berk New Member

    Joined:
    Nov 22, 2016
    Messages:
    17
    Likes Received:
    5
    No problem thank you very much again :) I use that MPU6050 which it is external 6 axis sensor. But I sometimes take angles from UDOO NEO. I consider that commands for greater project than prototype. I have a problem with UDOO now, I am thinking this problem about sampling time. So, I am trying that with Arduino Nano. If I fix this problem, I consider sampling time of UDOO again ;)
     
  7. Berk

    Berk New Member

    Joined:
    Nov 22, 2016
    Messages:
    17
    Likes Received:
    5
    Sorry for late response, I am so busy :(
     
    waltervl likes this.

Share This Page