title: Xively Arduino put for single datastream
body: <p>I have created two datastream in xively from one I want to send data on xively and from one I want to get but while using put method it is changing my both value but I dont want to update one of the data stream i am using xively.put method for this</p>
  
  <pre><code>#include &lt;SPI.h&gt;  //spi library
  #include &lt;Ethernet.h&gt; //ethernet library 
  #include &lt;HttpClient.h&gt;//http client library
  #include &lt;Xively.h&gt; //xively library
  
  
  //using the mac id of ethernrt shield Mac_ID =  90-A2-DA-0E-99-85 
  byte mac[] = { 0x90, 0xA2, 0xDA, 0x0E, 0x99, 0x85 };
  
  //Xively api key for upload and download
  char xivelyKey[] = "api_key";
  
  // Dtastream id i.e Device create in Xively account with same name otherwise will get an error
  char ledId[] = "led";
  char sensorId[]="stepper";
  
  int sensorPin = A0;    // select the input pin for the potentiometer
  int ledPin = 13;      // select the pin for the LED
  int sensorValue = 0; 
  
  //Initializing the xively datastream for the devices created in xively account
  
  XivelyDatastream datastreams[] = {
    XivelyDatastream(ledId, strlen(ledId), DATASTREAM_FLOAT),
    XivelyDatastream(sensorId, strlen(sensorId), DATASTREAM_FLOAT),
  };
  
  //The  transmission happen through feed initialize it
  //XivelyFeed feed(FEED_ID,XIVELY_DATASTREAM,NO_OF_DATASTREAM)
  XivelyFeed feed(feedid, datastreams, 2);
  
  //Initializing the ethernet client for http support 
  EthernetClient myclient;
  
  //Use the ethernet client to initialize xively client
  XivelyClient xivelyclient(myclient);
  
  
  /* Initial setup of arduino */ 
  void setup(){
    /* initialize the serial communication to monitor the transmission */
    //starting the serial communication with the baud rate 9600
    Serial.begin(9600);
  
    Serial.println("Serial Communication started");
    Serial.println();
  
    //assigning the ip address using dhcp
    while (Ethernet.begin(mac) != 1){
       Serial.println("Error getting IP address via DHCP, trying again...");
       delay(15000);
    }
  }
  
  /* loop for doing continous upload and dowload of data*/
  void loop(){
      int sensor;
      sensor=analogRead(sensorPin);
  
      datastreams[1].setFloat(sensor);
  
    /* uploading the data */ 
        Serial.print("uploading data of stepper");
      Serial.println(datastreams[1].getFloat());
  
      Serial.println("Uploading it to Xively");
      while((xivelyclient.put(feed, xivelyKey) != 200));
      Serial.println();
      delay(15000);
  
      Serial.println("uploading of data completed");
    /* finidh uploading data*/
  
    /* Downloading the data*/
      Serial.println("downloading data");
      while((xivelyclient.get(feed, xivelyKey) != 200));
  
      Serial.println("Datastream is...");
      Serial.println(feed[0]);
      Serial.println("Datastream is...");
      Serial.println(feed[1]);
  
  
      Serial.print("stepper motor downloaded data is: ");
      Serial.println(feed[1].getFloat());
  
      Serial.println("downloadind data completed");
      Serial.println();
      delay(15000);
    /* Downloading data completed */
  
  }
  </code></pre>