Hello, my group and I are working with the Arduino and keep getting this error. Can someone help ? Here is the section of code the error is coming from.
void setup(void)
{
Serial.begin(115200);
Serial.println(F("Hello, CC3000!\n"));
Serial.print("Free RAM: "); Serial.println(getFreeRam(), DEC);
/* Initialise the module */
Serial.println(F("\nInitializing..."));
if (!cc3000.begin())
{
Serial.println(F("Couldn't begin()! Check your wiring?"));
while (1);
}
// Optional SSID scan
// listSSIDResults();
Serial.print(F("\nAttempting to connect to ")); Serial.println(WLAN_SSID);
if (!cc3000.connectToAP(WLAN_SSID, WLAN_PASS, WLAN_SECURITY)) {
Serial.println(F("Failed!"));
while (1);
}
Serial.println(F("Connected!"));
/* Wait for DHCP to complete */
Serial.println(F("Request DHCP"));
while (!cc3000.checkDHCP())
{
delay(100); // ToDo: Insert a DHCP timeout!
}
/* Display the IP address DNS, Gateway, etc. */
while (! displayConnectionDetails()) {
delay(1000);
}
ip = 0;
// Try looking up the website's IP address
Serial.print(WEBSITE); Serial.print(F(" -> "));
while (ip == 0) {
if (! cc3000.getHostByName(WEBSITE, &ip)) {
Serial.println(F("Couldn't resolve!"));
}
delay(500);
}
cc3000.printIPdotsRev(ip);
//Get data and transform integrs
float horizontal = Adafruit_Sensor.readx_axis();
float vertical = Adafruit_Sensor.ready_axis();
float diagonal = Adafruit_Sensor.readz_axis();
int x_axis = (int) horizontal;
int y_axis = (int) vertical;
int z_axis = (int) diagonal;
//prepare for xively
int length = 0;
String data = "";
data = data + "\n" + "{"version":"1.0.0","datastreams" : [ "
- "{"id" : "X Axis","current_value" : "" + String(horizontal) + ""},"
- "{"id" : "Y Axis","current_value" : "" + String(vertical) + ""},"
- "{"id" : "Z Axis","current_value" : "" + String(diagonal) + ""}]}";
length = data.length();
Serial.print("Data length");
Serial.println(length);
Serial.println();
Adafruit_CC3000_Client client = cc3000.connectTCP(ip, 80);
if (client.connected()) {
Serial.println("Connected to Xively server.");
client.println("PUT /v2\feeds/" + String(feedID) + ".json HTTP/1.0");
client.println(("Host: api.xively.com "));
client.println((" HTTP/1.1\r\n"));
client.print("Connection: close");
client.println("Content-length: " + String(length));
client.println();
client.print(data);
client.println("X-ApiKey: " + String(API_key));
client.println();
} else {
Serial.println(F("Connection failed"));
return;
}
The red line is where the error occurs