aide sur pachube

bonjour a tous,
comme d'habitude, je viens demander un peu d'aide.

j'utilise ce programe pour envoyer quelques infos sur pachube. cela marche trés j'arrive à envoyer l'info d'une entrées analogique via le module wifly.

#include <Client.h>
#include <Server.h>
#include <WiFly.h>



//  The address of the server you want to connect to (pachube.com):
byte server[] = {209,40,205,190 }; 

// initialize the library instance:
Client client(server, 80);

long lastConnectionTime = 0;        // last time you connected to the server, in milliseconds
boolean lastConnected = false;      // state of the connection last time through the main loop
const int postingInterval = 10000;  //delay between updates to Pachube.com

void setup() {

  Serial.begin(9600);
  // give the ethernet module time to boot up:
  WiFly.begin();
  delay(1000);
}

void loop() {
  // read the analog sensor:
  int sensorReading = analogRead(A0);
   

  // if there's incoming data from the net connection.
  // send it out the serial port.  This is for debugging
  // purposes only:
  if (client.available()) {
    char c = client.read();
    Serial.print(c);
  }

  // if there's no net connection, but there was one last time
  // through the loop, then stop the client:
  if (!client.connected() && lastConnected) {
    Serial.println();
    Serial.println("disconnecting.");
    client.stop();
  }

  // if you're not connected, and ten seconds have passed since
  // your last connection, then connect again and send data:
  if(!client.connected() && (millis() - lastConnectionTime > postingInterval)) {
    sendData(sensorReading);
    
  }
  // store the state of the connection for next time through
  // the loop:
  lastConnected = client.connected();
}

// this method makes a HTTP connection to the server:
void sendData(int thisData) {
  // if there's a successful connection:
  if (client.connect()) {
    Serial.println("connecting...");
    // send the HTTP PUT request. 
    // fill in your feed address here:
    client.print("PUT /api/*****.csv HTTP/1.1\n");
    client.print("Host: www.pachube.com\n");
    // fill in your Pachube API key here:
    client.print("X-PachubeApiKey: *************************************************************\n");
    client.print("Content-Length: ");

    // calculate the length of the sensor reading in bytes:
    int thisLength = getLength(thisData);
    client.println(thisLength, DEC);

    // last pieces of the HTTP PUT request:
    client.print("Content-Type: text/csv\n");
    client.println("Connection: close\n");

    // here's the actual content of the PUT request:
    client.println(thisData, DEC);

    // note the time that the connection was made:
    lastConnectionTime = millis();
  } 
  else {
    // if you couldn't make a connection:
    Serial.println("connection failed");
  }
}


// This method calculates the number of digits in the
// sensor reading.  Since each digit of the ASCII decimal
// representation is a byte, the number of digits equals
// the number of bytes:

int getLength(int someValue) {
  // there's at least one byte:
  int digits = 1;
  // continually divide the value by ten, 
  // adding one to the digit count for each
  // time you divide, until you're at 0:
  int dividend = someValue /10;
  while (dividend > 0) {
    dividend = dividend /10;
    digits++;
  }
  // return the number of digits:
  return digits;
}

le truc c'est que je souhaiterai envoie d'autre entrée analogique, des infos en mémoire...
Mais je ne sais pas comment on fait.

Dans un second temps si cela est possible, je souhaiterai dobber des instrictuion via pachube, mais là je suis totalement largué.

si vous aviez quelque exemple pour ceci et pour la commande via patchube.

Merci d'avance

flo

Bonjour,

Tu veux l'envoyer avec Serial ou avec WiFly ?

Peux-tu corriger tes fautes, je n'arrive pas à comprendre ce que tu as déjà réussi à faire et ce que tu n'arrives pas à faire.

c'est, mieux?

Désolé mais ce matin j'était à la bourre pour allez au boulot

Toutes mes excuses.

Avant toutes chose joyeux Noël a tous,

Personne ne peut m aider??

Un chit up