     lastMovementTime = movementTime;
 #endif
   }
+#endif
 }
 
 void movementDetected()

  }
}

void reportMovementCount(int aCount)
{
  GSM gsmAccess;     // include a 'true' parameter to enable debugging
  GPRS gprs;
  GSMClient client;
  XivelyClient xivelyclient(client);

  // connection state
  boolean notConnected = true;
  // After starting the modem with GSM.begin()

      digitalWrite(4, LOW);
    }
  }

#if DEBUG
  Serial.println("connected");
#endif
  // Set current value to whatever the last reading was
  datastreams[0].setFloat(batteryReadings[kReadingsPerReport-1].getFloat());
  datastreams[1].setInt(chargingReadings[kReadingsPerReport-1].getInt());
  datastreams[2].setInt(sensorReadings[kReadingsPerReport-1].getInt());
  datastreams[3].setInt(freeMemReadings[kReadingsPerReport-1].getInt());
  
  // Sort out the times FIXME!!!
  for (int idx = 0; idx < kReadingsPerReport; idx++)
  {
    batteryReadings[idx].setTime(readingsTime);
    chargingReadings[idx].setTime(readingsTime);
    sensorReadings[idx].setTime(readingsTime);
    freeMemReadings[idx].setTime(readingsTime);
    readingsTime += kReadingInterval*60;
  }
  
#if DEBUG
  Serial.println("putting data");
  Serial.println(feed);
#endif
  if (xivelyclient.put(feed, xivelyKey) < 0)
  {
    // Something went wrong
