parse-community / parse-embedded-sdks

The Embedded SDKs for the Parse Platform
http://parseplatform.org
Other
246 stars 118 forks source link

error: 'Parse' was not declared in this scope #73

Open abhirocks550 opened 8 years ago

abhirocks550 commented 8 years ago

Hello i am getting error: 'Parse' was not declared in this scope

following is my code :

include //Libray for JSON parsing

include //Parse Library

include

include

char mac_id[] = "B4:21:8A:F0:00:AE"; //MAC ID of Arduino Device char char_installationId[] = ""; //MAC ID of Arduino Device

static int counter =0; //Counter to call setup function after sometime. int push_button = 3; //Push Button is used to book room int button_counter = 0; //this is used to toggle room book/cancel boolean isButtonPressed = false;

/*** setup function

}//setup function block

/*** checkButtonStatus function

-This function will detect whether button is pressed or not **/ void checkButtonStatus() { Serial.print("Pressed button"); isButtonPressed = true; }

/*** connect_to_Parse function

void connect_to_Parse() { Serial.println("Connect to parse"); //CONNECT TO PARSE CLOUD // Initialize Parse Parse.begin("NR9dHycpjgUn0Bcem3lH1q0jniHSiynGh5yKe4Ws", "lC066NvhZDCfucTVB5yfaJCOyE2LhClq3T1OcxF6");

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

 String installationId = Parse.getInstallationId();     
 installationId.toCharArray(char_installationId,40);

}

void insertMacDetails_parse() { Serial.println("Insert mac details ");

if(counter == 0) { ParseCloudFunction cloudFunction; cloudFunction.setFunctionName("InsertArduinoMacID"); cloudFunction.add("mac_id", mac_id); ParseResponse response = cloudFunction.send();

    ParseCloudFunction cloudfn;
    cloudfn.setFunctionName("insertMacinInstallation");
    cloudfn.add("mac_id", mac_id);
    cloudfn.add("char_installationId",char_installationId);
    ParseResponse response1 = cloudfn.send();

}//if counter==0 block

}//insertMacDetails_parse function block

/*** loop function

void loop() {

//attachInterrupt(digitalRead(2),checkButtonStatus,HIGH); counter++; Serial.println("In loop "); // Serial.println(counter); checkPush_parse(); //check whether there is any Push notification or not // push_button_book_parse(); //Book or cancel room reservation send_sensorData_parse(); //send Sensor data to parse

if(counter % 10 == 0){ setup(); }//CALL SETUP AFTER SOME TIME.THIS SOLVED PUSH AND CONTINUOS CLOUD CODE CALL ISSUE.

if(isButtonPressed == true) { push_button_book_parse(); }

} //loop function block

/*** checkPush_parse function

}//checkPush_parse function block

can someone help for this? Thanks

mtl2034 commented 8 years ago

Hi @abhirocks550,

some more information would be useful:

  1. What device are you running on? Looks like Arduino code but not certain. (If so better place to ask questions is https://github.com/ParsePlatform/Parse-SDK-Arduino)?
  2. What version of the SDK are you running?
  3. If you are running on Arduino Yun:

Damian