0

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

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
}
4

1 回答 1

0

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

http://arduino.cc/en/main/software#toc3

于 2015-01-13T15:55:17.097 回答