Connecting two ultrasonic sensors to arduino and collecting the two sensors data on cloud

I HAVE WRITTEN THIS CODE TO CONNECT TWO ULTRASOUND SENSORS AND I HAVE CREATED A PRODUCT IN CLOUD PAGE, AS ‘CSV 1’ AND ‘CSV2’ BUT I AM NOT GETTING ANY OUTPUT. WHAT WILL BE THE PROBLEM??

#include <Ultrasonic.h>
#include <BoltIoT-Arduino-Helper.h>

#define ULTRASONIC_TRIG_PIN 11
#define ULTRASONIC_ECHO_PIN 12
#define ULTRASONIC_TRIG_PIN1 22
#define ULTRASONIC_ECHO_PIN1 24

Ultrasonic ultrasonic(ULTRASONIC_TRIG_PIN,ULTRASONIC_ECHO_PIN);
Ultrasonic ultrasonic1(ULTRASONIC_TRIG_PIN1, ULTRASONIC_ECHO_PIN1);
int distance = 2;
int distance1 = 1;

String getDistance(String *arguments) {
  distance = ultrasonic.read();
  String returnString=""+String(distance);
  return returnString;
  distance1 = ultrasonic1.read();
  String returnString1 = "" + String(distance1);
  return returnString1;
}
void setup() {
  boltiot.begin(Serial);

  //put your setup code here, to run once:
  boltiot.setCommandString("RD\r", getDistance);
  boltiot.setCommandString("GetDistance", getDistance);
  boltiot.setCommandString("RD1\r1", getDistance);
  boltiot.setCommandString("GetDistance1", getDistance);
}
void loop() {
  boltiot.handleCommand();
  // put your main code here, to run repeatedly:

}

Yes I also want the answer of this question

Hi @ansusharma12345,

I am inviting my @vinayak.joshi to answer this query. He will reply you by tomorrow EOD.

Hi @ansusharma12345,

Here is the right way to get this to work.

#include <Ultrasonic.h>
#include <BoltIoT-Arduino-Helper.h>

#define ULTRASONIC_TRIG_PIN 11
#define ULTRASONIC_ECHO_PIN 12
#define ULTRASONIC_TRIG_PIN1 22
#define ULTRASONIC_ECHO_PIN1 24

Ultrasonic ultrasonic(ULTRASONIC_TRIG_PIN,ULTRASONIC_ECHO_PIN);
Ultrasonic ultrasonic1(ULTRASONIC_TRIG_PIN1, ULTRASONIC_ECHO_PIN1);
int distance = 2;
int distance1 = 1;

String getDistance(String *arguments) {
  String returnString=""+String(distance) + "," + String(distance1);
}
void setup() {
  boltiot.begin(Serial);

  //put your setup code here, to run once:
  boltiot.setCommandString("RD\r", getDistance);
  boltiot.setCommandString("GetDistance", getDistance);
}
void loop() {
  boltiot.handleCommand();
  distance = ultrasonic.read();
  distance1 = ultrasonic1.read();
  // put your main code here, to run repeatedly:

}

Could you please help me with what code would I need to use in the cloud platform and what are the settings which I need to do?