Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
edited tags
Link
user31481
user31481
Tweeted twitter.com/StackArduino/status/926706055102550022
Fix code formatting and typos
Source Link
per1234
  • 4.3k
  • 2
  • 24
  • 44

I have created a cloud function using the Parse.com Javascript SDK and iI am calling those functions from Arduino.Following Following is code for the hello function hello:

Parse.Cloud.define("hello", function(request, response) {
                response.success("This is hello function");         
}); //hello function Block

I am calling this function from Arduino side using following code.

void setup() {

     Bridge.begin();
     Serial.begin(9600);

     while(!Serial);

     Parse.begin("***zE0uUjQkMa7nj5D5BALvzegzfyVNSG22BD***", "***Ssggp5JgMFmSHfloewW5oixlM5ibt9LBSE***"); 
          //commented my keys with * here only
      
     // In this example, we associate this device with a pre-generated installation
     Parse.getInstallationId();
     Parse.startPushService();
}


void loop() {

          Serial.println("Start loop");
          demoBasic("meeting",0);
}

void demoBasic(String functionname,int light){
     
      char fnname[11];
      functionname.toCharArray(fnname,11);
      
     Serial.print("In ");
     Serial.print(functionname);
     Serial.println(" Function");
     
     
     ParseCloudFunction cloudFunction;
     cloudFunction.setFunctionName(fnname);
     cloudFunction.add("light_sensor", light);
     cloudFunction.add("value", "Arduino Hello");//parameters
     
     ParseResponse response = cloudFunction.send();
     Serial.println(response.getJSONBody());
}//function block for demoBasic
Parse.Cloud.define("hello", function(request, response) {
                response.success("This is hello function");         
}); //hello function Block

I am calling this function from the Arduino side using the following code:

void setup() {
  Bridge.begin();
  Serial.begin(9600);

  while (!Serial);

  Parse.begin("***zE0uUjQkMa7nj5D5BALvzegzfyVNSG22BD***", "***Ssggp5JgMFmSHfloewW5oixlM5ibt9LBSE***");
  //commented my keys with * here only

  // In this example, we associate this device with a pre-generated installation
  Parse.getInstallationId();
  Parse.startPushService();
}


void loop() {
  Serial.println("Start loop");
  demoBasic("meeting", 0);
}

void demoBasic(String functionname, int light) {
  char fnname[11];
  functionname.toCharArray(fnname, 11);

  Serial.print("In ");
  Serial.print(functionname);
  Serial.println(" Function");


  ParseCloudFunction cloudFunction;
  cloudFunction.setFunctionName(fnname);
  cloudFunction.add("light_sensor", light);
  cloudFunction.add("value", "Arduino Hello");//parameters

  ParseResponse response = cloudFunction.send();
  Serial.println(response.getJSONBody());
}

Problem is that iI am getting response 8 times only after. After that whole program flow gets blocked.What What is the problem,can somebody help please?

I have created cloud function using Parse.com Javascript SDK and i am calling those functions from Arduino.Following is code for function hello

Parse.Cloud.define("hello", function(request, response) {
                response.success("This is hello function");         
}); //hello function Block

I am calling this function from Arduino side using following code.

void setup() {

     Bridge.begin();
     Serial.begin(9600);

     while(!Serial);

     Parse.begin("***zE0uUjQkMa7nj5D5BALvzegzfyVNSG22BD***", "***Ssggp5JgMFmSHfloewW5oixlM5ibt9LBSE***"); 
          //commented my keys with * here only
      
     // In this example, we associate this device with a pre-generated installation
     Parse.getInstallationId();
     Parse.startPushService();
}


void loop() {

          Serial.println("Start loop");
          demoBasic("meeting",0);
}

void demoBasic(String functionname,int light){
     
      char fnname[11];
      functionname.toCharArray(fnname,11);
      
     Serial.print("In ");
     Serial.print(functionname);
     Serial.println(" Function");
     
     
     ParseCloudFunction cloudFunction;
     cloudFunction.setFunctionName(fnname);
     cloudFunction.add("light_sensor", light);
     cloudFunction.add("value", "Arduino Hello");//parameters
     
     ParseResponse response = cloudFunction.send();
     Serial.println(response.getJSONBody());
}//function block for demoBasic

Problem is that i am getting response 8 times only after that whole program flow gets blocked.What is the problem,can somebody help please?

I have created a cloud function using the Parse.com Javascript SDK and I am calling those functions from Arduino. Following is code for the hello function:

Parse.Cloud.define("hello", function(request, response) {
                response.success("This is hello function");         
}); //hello function Block

I am calling this function from the Arduino side using the following code:

void setup() {
  Bridge.begin();
  Serial.begin(9600);

  while (!Serial);

  Parse.begin("***zE0uUjQkMa7nj5D5BALvzegzfyVNSG22BD***", "***Ssggp5JgMFmSHfloewW5oixlM5ibt9LBSE***");
  //commented my keys with * here only

  // In this example, we associate this device with a pre-generated installation
  Parse.getInstallationId();
  Parse.startPushService();
}


void loop() {
  Serial.println("Start loop");
  demoBasic("meeting", 0);
}

void demoBasic(String functionname, int light) {
  char fnname[11];
  functionname.toCharArray(fnname, 11);

  Serial.print("In ");
  Serial.print(functionname);
  Serial.println(" Function");


  ParseCloudFunction cloudFunction;
  cloudFunction.setFunctionName(fnname);
  cloudFunction.add("light_sensor", light);
  cloudFunction.add("value", "Arduino Hello");//parameters

  ParseResponse response = cloudFunction.send();
  Serial.println(response.getJSONBody());
}

Problem is that I am getting response 8 times only. After that whole program flow gets blocked. What is the problem?

added 184 characters in body
Source Link
Gerben
  • 11.3k
  • 3
  • 22
  • 34

I have created cloud function using Parse.com Javascript SDK and i am calling those functions from Arduino.Following is code for function hello

Parse.Cloud.define("hello", function(request, response) { response.success("This is hello function");
}); //hello function Block

I am calling this function from Arduino side using following code.

void setup() {

Parse.Cloud.define("hello", function(request, response) {
                response.success("This is hello function");         
}); //hello function Block

I am calling this function from Arduino side using following code.

void setup() {

     Bridge.begin();
     Serial.begin(9600);

     while(!Serial);

     Parse.begin("***zE0uUjQkMa7nj5D5BALvzegzfyVNSG22BD***", "***Ssggp5JgMFmSHfloewW5oixlM5ibt9LBSE***"); 
          //commented my keys with * here only
      
     // In this example, we associate this device with a pre-generated installation
     Parse.getInstallationId();
     Parse.startPushService();

}

void loop() {

}


void loop() {

          Serial.println("Start loop");
          demoBasic("meeting",0);

}

void demoBasic(String functionname,int light){

}

void demoBasic(String functionname,int light){
     
      char fnname[11];
      functionname.toCharArray(fnname,11);
      
     Serial.print("In ");
     Serial.print(functionname);
     Serial.println(" Function");
     
     
     ParseCloudFunction cloudFunction;
     cloudFunction.setFunctionName(fnname);
     cloudFunction.add("light_sensor", light);
     cloudFunction.add("value", "Arduino Hello");//parameters
     
     ParseResponse response = cloudFunction.send();
     Serial.println(response.getJSONBody());
}//function block for demoBasic

}//function block for demoBasic

Problem is that i am getting response 8 times only after that whole program flow gets blocked.What is the problem,can somebody help please?

I have created cloud function using Parse.com Javascript SDK and i am calling those functions from Arduino.Following is code for function hello

Parse.Cloud.define("hello", function(request, response) { response.success("This is hello function");
}); //hello function Block

I am calling this function from Arduino side using following code.

void setup() {

 Bridge.begin();
 Serial.begin(9600);

 while(!Serial);

 Parse.begin("***zE0uUjQkMa7nj5D5BALvzegzfyVNSG22BD***", "***Ssggp5JgMFmSHfloewW5oixlM5ibt9LBSE***"); 
      //commented my keys with * here only
  
 // In this example, we associate this device with a pre-generated installation
 Parse.getInstallationId();
 Parse.startPushService();

}

void loop() {

      Serial.println("Start loop");
      demoBasic("meeting",0);

}

void demoBasic(String functionname,int light){

  char fnname[11];
  functionname.toCharArray(fnname,11);
  
 Serial.print("In ");
 Serial.print(functionname);
 Serial.println(" Function");
 
 
 ParseCloudFunction cloudFunction;
 cloudFunction.setFunctionName(fnname);
 cloudFunction.add("light_sensor", light);
 cloudFunction.add("value", "Arduino Hello");//parameters
 
 ParseResponse response = cloudFunction.send();
 Serial.println(response.getJSONBody());

}//function block for demoBasic

Problem is that i am getting response 8 times only after that whole program flow gets blocked.What is the problem,can somebody help please?

I have created cloud function using Parse.com Javascript SDK and i am calling those functions from Arduino.Following is code for function hello

Parse.Cloud.define("hello", function(request, response) {
                response.success("This is hello function");         
}); //hello function Block

I am calling this function from Arduino side using following code.

void setup() {

     Bridge.begin();
     Serial.begin(9600);

     while(!Serial);

     Parse.begin("***zE0uUjQkMa7nj5D5BALvzegzfyVNSG22BD***", "***Ssggp5JgMFmSHfloewW5oixlM5ibt9LBSE***"); 
          //commented my keys with * here only
      
     // In this example, we associate this device with a pre-generated installation
     Parse.getInstallationId();
     Parse.startPushService();
}


void loop() {

          Serial.println("Start loop");
          demoBasic("meeting",0);
}

void demoBasic(String functionname,int light){
     
      char fnname[11];
      functionname.toCharArray(fnname,11);
      
     Serial.print("In ");
     Serial.print(functionname);
     Serial.println(" Function");
     
     
     ParseCloudFunction cloudFunction;
     cloudFunction.setFunctionName(fnname);
     cloudFunction.add("light_sensor", light);
     cloudFunction.add("value", "Arduino Hello");//parameters
     
     ParseResponse response = cloudFunction.send();
     Serial.println(response.getJSONBody());
}//function block for demoBasic

Problem is that i am getting response 8 times only after that whole program flow gets blocked.What is the problem,can somebody help please?

edited body
Source Link
Loading
Source Link
Loading