B4R Question Obtain data from I2C

Discussion in 'B4R Questions' started by tonga, Oct 24, 2018.

  1. tonga

    tonga Member Licensed User

    Hi,
    I am acquiring data from a microcontroller by means of I2C. There are 30 total bytes that are grouped into bytes or integers. I get them by means of this function:

    Dim c() As Byte = master.RequestFrom(SLAVE_ADDRESS, 30)

    I see them with oscilloscope but I can not separate them and read them for my use.
    How can I proceed?

    Thanks in advance
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Please use [code]code here...[/code] tags when posting code.

    What is the output of:
    Code:
    Dim bc As ByteConverter 'rRandomAccessFile
    Log(bc.HexFromBytes(c))
     
  3. tonga

    tonga Member Licensed User

    I don't read nothing in the logs
     
  4. tigrot

    tigrot Well-Known Member Licensed User

    Read less bytes from I2C. Just to see if you can get at least a few bytes. Is SLAVE_ADDRESS defined correctly?
     
  5. tonga

    tonga Member Licensed User

    I read only 1 byte. SLAVE _ADDRESS is correct.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice