Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/arduino/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Twitter 在此作用域中未声明TembooChoreo_Twitter_Arduino_Temboo - Fatal编程技术网

Twitter 在此作用域中未声明TembooChoreo

Twitter 在此作用域中未声明TembooChoreo,twitter,arduino,temboo,Twitter,Arduino,Temboo,我是Temboo的新用户,我正在尝试使用他们的Choreo与Arduino和Twitter互动。当我从Temboo生成代码并尝试在ArduinoIDE中验证它时,我得到了这些错误 UserTimeline_Twitter.ino: In function 'void loop()': UserTimeline_Twitter:52: error: 'TembooChoreo' was not declared in this scope UserTimeline_Twitter:52: erro

我是Temboo的新用户,我正在尝试使用他们的Choreo与Arduino和Twitter互动。当我从Temboo生成代码并尝试在ArduinoIDE中验证它时,我得到了这些错误

UserTimeline_Twitter.ino: In function 'void loop()':
UserTimeline_Twitter:52: error: 'TembooChoreo' was not declared in this scope
UserTimeline_Twitter:52: error: expected `;' before 'MentionsChoreo'
UserTimeline_Twitter:55: error: 'MentionsChoreo' was not declared in this scope
有人能解释一下我为什么会犯这个错误吗?谢谢

下面是代码示例

 #include <SPI.h>
#include <WiFi.h>
#include <WiFiClient.h>
#include <Temboo.h>
#include "TembooAccount.h" // Contains Temboo account information

WiFiClient client;

int numRuns = 1;   // Execution count, so this doesn't run forever
int maxRuns = 10;   // Maximum number of times the Choreo should be executed

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

  // For debugging, wait until the serial console is connected.
  delay(4000);
  while(!Serial);

  int wifiStatus = WL_IDLE_STATUS;

  // Determine if the WiFi Shield is present.
  Serial.print("\n\nShield:");
  if (WiFi.status() == WL_NO_SHIELD) {
    Serial.println("FAIL");

    // If there's no WiFi shield, stop here.
    while(true);
  }

  Serial.println("OK");

  // Try to connect to the local WiFi network.
  while(wifiStatus != WL_CONNECTED) {
    Serial.print("WiFi:");
    wifiStatus = WiFi.begin(WIFI_SSID, WPA_PASSWORD);

    if (wifiStatus == WL_CONNECTED) {
      Serial.println("OK");
    } else {
      Serial.println("FAIL");
    }
    delay(5000);
  }

  Serial.println("Setup complete.\n");
}

void loop() {
  if (numRuns <= maxRuns) {
    Serial.println("Running Mentions - Run #" + String(numRuns++));

    TembooChoreo MentionsChoreo(client);

    // Invoke the Temboo client
    MentionsChoreo.begin();

    // Set Temboo account credentials
    MentionsChoreo.setAccountName(TEMBOO_ACCOUNT);
    MentionsChoreo.setAppKeyName(TEMBOO_APP_KEY_NAME);
    MentionsChoreo.setAppKey(TEMBOO_APP_KEY);

    // Set profile to use for execution
    MentionsChoreo.setProfile("TwitterAccount");

    // Set Choreo inputs
    String CountValue = "5";
    MentionsChoreo.addInput("Count", CountValue);

    // Identify the Choreo to run
    MentionsChoreo.setChoreo("/Library/Twitter/Timelines/Mentions");

    // Run the Choreo; when results are available, print them to serial
    MentionsChoreo.run();

    while(MentionsChoreo.available()) {
      char c = MentionsChoreo.read();
      Serial.print(c);
    }
    MentionsChoreo.close();
  }

  Serial.println("\nWaiting...\n");
  delay(30000); // wait 30 seconds between Mentions calls
}

看起来你没有安装Temboo的Arduino库。Arduino IDE 1.0.x的旧版本默认情况下不附带Temboo库,因此我建议升级到最新的1.5.x版本。您可以在此处下载Arduino软件: