Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Read out an A/D (LTC2400) on I2C
QtWS25 Last Chance

Read out an A/D (LTC2400) on I2C

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
5 Posts 2 Posters 342 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    inexpert
    wrote on last edited by
    #1

    I want to read out an LTC2400 on I2C-bus.
    the command in linux : i2cget - y 2 0x28 (bus =2, device = 0x28)
    this works.

    Because my qt.-programm is in C++, I tried with command:
    system("i2cget - y 2 0x28")
    this works not.
    Please can you help me.

    JonBJ 1 Reply Last reply
    0
    • I inexpert

      I want to read out an LTC2400 on I2C-bus.
      the command in linux : i2cget - y 2 0x28 (bus =2, device = 0x28)
      this works.

      Because my qt.-programm is in C++, I tried with command:
      system("i2cget - y 2 0x28")
      this works not.
      Please can you help me.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @inexpert
      If you show your command as i2cget - y 2 0x28 (bus =2, device = 0x28) why do you only enter i2cget - y 2 0x28, that's not the same?

      this works not.

      Define "works not"? Did you check exit code? Did you check whatever was written to stdout/stderr?

      So long as you use system() this question has nothing to do with Qt.

      Use Qt's QProcess to start(), waitForFinished() and readAll() if you want to use Qt calls and fetch any output.

      I 1 Reply Last reply
      1
      • JonBJ JonB

        @inexpert
        If you show your command as i2cget - y 2 0x28 (bus =2, device = 0x28) why do you only enter i2cget - y 2 0x28, that's not the same?

        this works not.

        Define "works not"? Did you check exit code? Did you check whatever was written to stdout/stderr?

        So long as you use system() this question has nothing to do with Qt.

        Use Qt's QProcess to start(), waitForFinished() and readAll() if you want to use Qt calls and fetch any output.

        I Offline
        I Offline
        inexpert
        wrote on last edited by
        #3

        ****~~```
        [bolded text](link url)

        1 Reply Last reply
        0
        • I Offline
          I Offline
          inexpert
          wrote on last edited by
          #4

          Thank you for your reply.
          The command in Linux is
          i2cget - y 2 0x28
          In bracket (bus = 2, device = 0x28) is only to explain what 2 and 0x28 mean.
          „works not“ mean that the exit code is always 0x01 instead of the correct
          value 0x20.
          I thougt that I have in C++ , the Linux [link text](![link url](image url))command to give as parameter in the function system().

          JonBJ 1 Reply Last reply
          0
          • I inexpert

            Thank you for your reply.
            The command in Linux is
            i2cget - y 2 0x28
            In bracket (bus = 2, device = 0x28) is only to explain what 2 and 0x28 mean.
            „works not“ mean that the exit code is always 0x01 instead of the correct
            value 0x20.
            I thougt that I have in C++ , the Linux [link text](![link url](image url))command to give as parameter in the function system().

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by
            #5

            @inexpert said in Read out an A/D (LTC2400) on I2C:

            mean that the exit code is always 0x01 instead of the correct
            value 0x20.

            As suggested then: instead of system() use QProcess and its methods to show you any output (including error message) is likely being produced.

            1 Reply Last reply
            1

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved