 
 #define USE_SERIAL Serial
 
+String row =""; 
+
 const char* ssid     = "HackBulgaria";
 const char* password = "";
 

  }


  G[0] = alpha * G[0] + (1-alpha) * accel.X;
  G[1] = alpha * G[1] + (1-alpha) * accel.Y;
  G[2] = alpha * G[2] + (1-alpha) * accel.Z;
  
  //char* row;
  //sprintf(row, "%d,%d,%d", accel.X - G[0], accel.Y - G[1], accel.Z - G[2]);
  
  String row = String(int(accel.X - G[0])) + "," + String(int(accel.Y - G[1])) + "," + String(int(accel.Z - G[2]));
  Serial.println(row);
  
  
  // We now create a URI for the request
  String url = "/stream";
  String tsData = String(accel.X);
  //Serial.println(tsData);
  
  Serial.print("Requesting URL: ");
  Serial.println(url);


  
  // This will send the request to the server
  client.print(String("POST ") + url + " HTTP/1.1\r\n" + "Host: " + host + "\r\n");
  client.print("Content-Type: application/x-www-form-urlencoded\r\n");

const char* streamId   = "....................";
const char* privateKey = "....................";

float G[3] = {0.0, 0.0, 0.0};
float alpha = 0.9;

long timer_read_from_accel = 0;
long timer_send_data_wifi = 0;
void setup() {
  Serial.begin(115200);
  delay(10);


  Serial.begin(9600);
  Wire.begin(2, 14);
  accel.begin(BMA250_range_2g, BMA250_update_time_4ms);//This sets up the BMA250 accelerometer
  USE_SERIAL.begin(115200);
  // USE_SERIAL.setDebugOutput(true);

  //    USE_SERIAL.println();
  //    USE_SERIAL.println();
  //    USE_SERIAL.println();

  for (uint8_t t = 4; t > 0; t--) {
    USE_SERIAL.printf("[SETUP] WAIT %d...\n", t);
    USE_SERIAL.flush();
    delay(1000);
  }

  // We start by connecting to a WiFi network

