Announcement

Collapse
No announcement yet.

API pass through multiple values

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • API pass through multiple values

    Hello Greig,

    Is there a way to pass to the HS3 multiple values from single device as part of a single string that are sent from the Arduino API? I have a module that is able to present two values but I am not able to capture them both in HS3.

    For example: SendToHS (1,data) provides this output 1,30.2,1.023
    HS 3 is able to see the 30.2 but not the 1.023

    I am able to see the data in the Arduino serial output window.

    Once received in HS3 I would like to assign the second value to another device.

    Do you have any suggestions on how make this work?

    Best Regards
    Mark

  • #2
    Originally posted by marekd1 View Post

    I am able to see the data in the Arduino serial output window.

    Once received in HS3 I would like to assign the second value to another device.

    Do you have any suggestions on how make this work?

    Best Regards
    Mark
    My workaround:
    split the data directly with arduino into some variables and send data to devices.
    Example:

    dataall = 1,30.2,1.023
    data1 = 30.2 (extract data you want)
    data2 = 1.023 (extract data you want)
    SendToHS (1,data1)
    SendToHS (2,data2)

    Comment


    • #3
      Originally posted by khriss75 View Post
      My workaround:
      split the data directly with arduino into some variables and send data to devices.
      Example:

      dataall = 1,30.2,1.023
      data1 = 30.2 (extract data you want)
      data2 = 1.023 (extract data you want)
      SendToHS (1,data1)
      SendToHS (2,data2)
      Thanks NICE!!!! This is nice workaround. I will give it a try.

      Comment


      • #4
        Originally posted by khriss75 View Post
        My workaround:
        split the data directly with arduino into some variables and send data to devices.
        Example:

        dataall = 1,30.2,1.023
        data1 = 30.2 (extract data you want)
        data2 = 1.023 (extract data you want)
        SendToHS (1,data1)
        SendToHS (2,data2)
        Okay this may be a dumb question but here is the problem.

        The output of 30.2,1.023 is part of output of a single variable sensordata.
        So basically sensordata is a variable that gets a reading and is presented with two values like in my previous example i.e 30.2,1.023. I am not sure how to extract from sensordata two variables to be data1 and data2 for the respective values.

        Can you give me an example how this can be done?

        Solved the problem with substring.... thanks for pointing me to the right direction!!!!
        Last edited by marekd1; September 7th, 2017, 10:38 AM.

        Comment


        • #5
          Originally posted by marekd1 View Post
          Solved the problem with substring.... thanks for pointing me to the right direction!!!!
          Great!

          Comment

          Working...
          X