Show Posts
Pages: 1 ... 13 14 [15] 16 17 ... 31
211  Using Arduino / Programming Questions / Re: Do I need a special library for strcpy and strcat on: July 15, 2013, 05:03:18 pm
I really because creasy and I think I have a lot of difficultire to understand char variable.

I rwrite my code because I make it to complicate with the getGPSCoords function. I deleted it.

I make it more simple, but my code stop responding for a reason I totaly ignore

When I enter 'send' in my terminal, the serial.println(coords); displays the right value
Quote
lo=608.482777&la=4613.163541&al=459.471680&ti=20130715215238&ve=0.000000
but when I comment the Serial.println(coords) and I uncomment the next line
Code:
//Serial.println(coords);
Serial.println(strlen(coords));
My code stop before Serial.println(strlen(coords));
Here is my code
Code:
    // SEND DATA
    if(!strcmp(inSerial,"send")){
        #ifdef DEBUG
          Serial.println(F(""));
          Serial.println(F("SENDING COORDS TO THE REMOTE SERVER"));
          Serial.println(F("---------------------------------------"));
        #endif
       
        #ifdef DEBUG
          stat=gps.getStat();
          if(stat==1){
            Serial.println(F("NOT FIXED"));
          }else if(stat==0){
            Serial.println(F("GPS OFF"));
          }else if(stat==2){
            Serial.println(F("2D FIXED"));
          }else if(stat==3){
            Serial.println(F("3D FIXED"));
          }
          delay(5000);
        #endif   
 
        //Get data from GPS
 
        gps.getPar(lon,lat,alt,time,vel);
     
       char coords[96];
       
        strcpy(coords,lo);          //3
        strncat(coords,lon,15);    //18
 
        strcat(coords,la);         //22
        strncat(coords,lat,15);    //37
 
        strcat(coords,al);         //41
        strncat(coords,alt,15);    //56

        strcat(coords,ti);         //60
        strncat(coords,time,14);   //74
 
        strcat(coords,ve);         //78
        strncat(coords,vel,15);    //93
 
        strcat(coords,en);       //95
       
        Serial.println(coords);
        //Serial.println(strlen(coords));
        /*
        inet.httpPOST(host, port_post, path_post, coords, "Result", 50);
        */
        delay(10000);
       
        enterCommand();
    }

Someone can tell me why??????

I hope after I will leave you "alone"  smiley
Thank for all
212  International / Français / Re: Pourquoi ma variable est detruite au fure et a mseure on: July 15, 2013, 01:37:53 pm
Voici ma fonction
Code:
char * getGPSCoords(void){
 
  #ifdef DEBUG
    stat=gps.getStat();
    if(stat==1){
      Serial.println(F("NOT FIXED"));
    }else if(stat==0){
      Serial.println(F("GPS OFF"));
    }else if(stat==2){
      Serial.println(F("2D FIXED"));
    }else if(stat==3){
      Serial.println(F("3D FIXED"));
    }
    delay(5000);
  #endif   
 
  //Get data from GPS
 
   gps.getPar(lon,lat,alt,time,vel);
 
  char lo[]="lo=";
  char la[]="&la=";
  char al[]="&al=";
  char ti[]="&ti=";
  char ve[]="&ve=";
  char en[]="\0";
 
 
  #ifdef DEBUG

  #endif
 
  int le = strlen(lo)+strlen(la)+strlen(al)+strlen(ti)+strlen(ve)+strlen(en)+strlen(lon)+strlen(lat)+strlen(alt)+strlen(vel)+strlen(time);
  /*
  char * coords;
  coords = (char*) malloc (le+1);
 */
 
  char coords[le];
 
  strcpy(coords,lo);
  strcat(coords,lon);
 
  strcat(coords,la);
  strcat(coords,lat);
 
  strcat(coords,al);
  strcat(coords,alt);

  strcat(coords,ti);
  strncat(coords,time,14);
 
  strcat(coords,ve);
  strcat(coords,vel);
 
  strcat(coords,en);
  /*
  #ifdef DEBUG
    Serial.print(F("Coords : "));                               
    Serial.println(coords);
   // Serial.println(strlen(coords));
  #endif
  */
 
  return coords;

}
213  International / Français / Re: Pourquoi ma variable est detruite au fure et a mseure on: July 15, 2013, 01:34:51 pm
Salut merci pour ta reponse.

Je ne fais pas malloc, il est commenté.
Je l'ai mis en commentaire parce que ca génère une erreur.
j'ai deja essayé strcpy mais encore ca fait une erreur.
Je t'avoir etre suis un peu largé. Pourrais je te demander un exemple?

Je ne suis pas habitué au manipulation...

Un grand merci

214  Using Arduino / Programming Questions / Why a constant char does not keep its value on: July 15, 2013, 12:54:35 pm
Dear All,

I am bit surpised to see that a const char does not keep it's value. I am passing a char variable in the fourth parameter of the function
Code:
inet.httpPOST(host, port_post, path_post, getGPSCoords() , "Result", 1000);

getGPSCoords() return an array (char):
Quote
lo=608.474403&la=4613.160156&al=466.355804&ti=20130715174943.000&ve=0.000000

The header of the function is
Code:
int InetGSM::httpPOST(const char* server, int port, const char* path, const char* parameters, char* result, int resultlength){
// code
Serial.println(parameters);
}

parameters is a const char but the Serial.print(), inside of the InetGSM function does not display what I show in the above quote. It trunk the value.
More I add Serial.print into the InetGSM function more it trunked.

Here is the full code of InetGSM
I add 6 Serial.print in that function and I show the result
Code:
int InetGSM::httpPOST(const char* server, int port, const char* path, const char* parameters, char* result, int resultlength)
{
        Serial.println(F("Starting to send"));
Serial.println(parameters); // lo=608.474403&la=4613.160156&al=466.355804&ti=20130715174950.3U79

Serial.println(parameters); // lo=608.474403&la=4613.160156&al=466.355804&ti=20130715174950


 
  boolean connected=false;
  int n_of_at=0;
  char itoaBuffer[8];
  int num_char;
  char end_c[2];
  end_c[0]=0x1a;
  end_c[1]='\0';

  while(n_of_at<3){
  if(!connectTCP(server, port)){
  #ifdef DEBUG_ON
Serial.println("DB:NOT CONN");
#endif
    n_of_at++;
  }
  else{
connected=true;
n_of_at=3;
}
  }

  if(!connected){
  Serial.println(F("Not connected"));
  return 0;
  }

Serial.println(parameters); // display : ^y
Serial.println(parameters); //display: : ^y


  gsm.SimpleWrite("POST ");
  gsm.SimpleWrite(path);
  gsm.SimpleWrite(" HTTP/1.1\nHost: ");
  gsm.SimpleWrite(server);
  gsm.SimpleWrite("\n");
  gsm.SimpleWrite("User-Agent: Arduino\n");
  gsm.SimpleWrite("Content-Type: application/x-www-form-urlencoded\n");
  gsm.SimpleWrite("Content-Length: ");
  itoa(strlen(parameters),itoaBuffer,10);
  gsm.SimpleWrite(itoaBuffer);
  gsm.SimpleWrite("\n\n");
  gsm.SimpleWrite(parameters);
  gsm.SimpleWrite("\n\n");
 
  gsm.SimpleWrite(end_c);
 
 Serial.println(parameters); // display : ^y
 Serial.println(parameters); /display : ^y
 
  switch(gsm.WaitResp(10000, 10, "SEND OK")){
case RX_TMOUT_ERR:
return 0;
break;
case RX_FINISHED_STR_NOT_RECV:
return 0;
break;
  }

 delay(50);
#ifdef DEBUG_ON
Serial.println("DB:SENT");
#endif

  int res= gsm.read(result, resultlength);
  Serial.println(F("Data sent"));
 
  //gsm.disconnectTCP();
  return res;
}

Is there any reasons?
Do you need more code?
215  International / Français / Re: Pourquoi ma variable est detruite au fure et a mseure on: July 15, 2013, 10:21:44 am
J'ai mis un commentaire à côte des
Quote
Serial.println(parameters);
Code:
int InetGSM::httpPOST(const char* server, int port, const char* path, const char* parameters, char* result, int resultlength)
{
        Serial.println(F("Starting to send"));
Serial.println(parameters); // Ceci lo=0.000000&la=0.000000&al=0.000000&ti=20130714213229.!Û%

Serial.println(parameters); // ceci lo=0.000000&la=0.000000&al=0.000000&ti=20130714213229.

  
  boolean connected=false;
  int n_of_at=0;
  char itoaBuffer[8];
  int num_char;
  char end_c[2];
  end_c[0]=0x1a;
  end_c[1]='\0';

  while(n_of_at<3){
 if(!connectTCP(server, port)){
  #ifdef DEBUG_ON
Serial.println("DB:NOT CONN");
#endif
    n_of_at++;
 }
 else{
connected=true;
n_of_at=3;
}
  }

  if(!connected){
   Serial.println(F("Not connected"));
   return 0;
  }

Serial.println(parameters); // Ceci affiche  : Ê
Serial.println(parameters); // Ceci affiche encore : Ê


  gsm.SimpleWrite("POST ");
  gsm.SimpleWrite(path);
  gsm.SimpleWrite(" HTTP/1.1\nHost: ");
  gsm.SimpleWrite(server);
  gsm.SimpleWrite("\n");
  gsm.SimpleWrite("User-Agent: Arduino\n");
  gsm.SimpleWrite("Content-Type: application/x-www-form-urlencoded\n");
  gsm.SimpleWrite("Content-Length: ");
  itoa(strlen(parameters),itoaBuffer,10);
  gsm.SimpleWrite(itoaBuffer);
  gsm.SimpleWrite("\n\n");
  gsm.SimpleWrite(parameters);
  gsm.SimpleWrite("\n\n");
  
  gsm.SimpleWrite(end_c);
 
 Serial.println(parameters); // et  Ceci affiche encore : Ê
 Serial.println(parameters); / et encore  Ceci affiche encore : Ê....
 
  switch(gsm.WaitResp(10000, 10, "SEND OK")){
case RX_TMOUT_ERR:
return 0;
break;
case RX_FINISHED_STR_NOT_RECV:
return 0;
break;
  }

 delay(50);
#ifdef DEBUG_ON
Serial.println("DB:SENT");
#endif

  int res= gsm.read(result, resultlength);
  Serial.println(F("Data sent"));
  
  //gsm.disconnectTCP();
  return res;
}

Selon les commentaire que j'ai mis dans le code, pourquoi 'parameters' perds sa valeurs???? alors qu'elle devrait rester
lo=0.000000&la=0.000000&al=0.000000&ti=20130714213222.000&ve=0.000000

Es-ce que j'ai fait un truc de faux dans ma function getGPSCoords() lorsque je retourne coords (return coords;)?

J'ai entendu parler de la declarer en static ou d'utiliser malloc(), mais la je suis largué car il faut que la taille de  char coords[] puisse s'adapter en fonction des tailles des positions GPS.

J'espère que vous m'avez compris et que j'ai été claire et si vous arriviez à me dépanner ca serat d'une très grande utilité!!

Milles mercis

Dite moi si vous avez besoin plsu de code!!!
216  International / Français / Pourquoi ma variable est detruite au fure et a mseure on: July 15, 2013, 10:14:01 am
Bonjour à tous,

Je suis sur un truc de fou mais je m'en sors avec perséveration  smiley.
Je suis pas trop expérimente c'est surement pourquoi, je prends tant de temps.....

J'ai une fonction qui doit me retourner un array. Je la declare comme ceci

Code:
char * getGPSCoords(void){
   // Je ne mets oas tous le code, a moins que vous en avez besoin.
   // Cette fonction fait appele a une autre pour collecter des positions GPS que je fusionne en une fonction. Etant donné que les valeurs et la longueur des valeur change, je calcule la taille de ces variable ainsi:


   // Je calcule la taille de toute les variables utilisée dans coords
   int le = strlen(lo)+strlen(la)+strlen(al)+strlen(ti)+strlen(ve)+strlen(en)+strlen(lon)+strlen(lat)+strlen(alt)+strlen(vel)+strlen(time);
   char coords[le];  
   /*
   char * coords;
   coords = (char*) malloc (le+1);
   */
   // C'est pourcela que je declare coords dans cette function car le peut changer et ainsi je suis sure de toujours avoir la taille de l'array en fonction des longeurs de toutes les variables correspondant aux positions GPS


   // A la fin je retourn coords pour l'exploiter plus loin
   // coords retournera 'lo=0.000000&la=0.000000&al=0.000000&ti=20130714213222.000&ve=0.000000'. Les zero, parce que je suis a un endorit qui ne choppe pas les positions, mais ca c'est pas grave pour le moment.
   return coords;
}

J'ai ensuite une action qui va envoyer les positions sur une base MySQL en POST, et c'est que les problèmes commencent.

Code:
// SEND DATA
// Quand je tape "send" dans mon terminal, il effectue ce code:
if(!strcmp(inSerial,"send")){
   #ifdef DEBUG
      Serial.println(F(""));
      Serial.println(F("SENDING COORDS TO THE REMOTE SERVER"));
      Serial.println(F("---------------------------------------"));
   #endif
        
   // Ceci affiche la valeur de mon array coords
   // Resultat : lo=0.000000&la=0.000000&al=0.000000&ti=20130714213222.000&ve=0.000000 (Dans le cas actuel, mon GPS ne capte pas de position, mais ca c'est pas grave pour le moment.
   Serial.println(getGPSCoords());


    // Ici c'est la fonction qui va envoyer "lo=0.000000&la=0.000000&al=0.000000&ti=20130714213222.000&ve=0.000000
" au serveur, et la les problème commence
    inet.httpPOST(host, port_post, path_post, getGPSCoords() , "Result", 4000);
    delay(10000);
 
}
Ici la fonction httpPOST(host,port_post, getGPSCoords,"Result",400). Je n'ai pas fait cette fonction. C'est une librairie que j'ai trouvé et qui semble pas mal...
Les problèmes commencent... et c'est peut etre tout simple à résoudre, mais j'ignore la parade.

NOTEZ BIEN que plus haut, Serial.println(getGPSCoords()), affiche bien ce que j'ai besoin, soit
Quote
lo=0.000000&la=0.000000&al=0.000000&ti=20130714213222.000&ve=0.000000

Le problème qu'au fure et à mesure que je fais un Serial.print(parameters), voir ci dessous, ma valeure
lo=0.000000&la=0.000000&al=0.000000&ti=20130714213222.000&ve=0.000000
est tronqué. Je perds des chifres.

Je mets le code de httpPOST(host,port_post, getGPSCoords,"Result",400) dans un reply afin d'avoir la place
217  Using Arduino / Programming Questions / Re: Do I need a special library for strcpy and strcat on: July 15, 2013, 09:00:33 am
Ok this is interrestinf but when I add "static", now it shoe an error

Code:
char* myFunction ()
{
 
int le = strlen(lo)+strlen(la)+strlen(al)+strlen(ti)+strlen(ve)+strlen(en)+strlen(lon)+strlen(lat)+strlen(alt)+strlen(vel)+strlen(time);
  /*
  char * coords;
  coords = (char*) malloc (le+1);
 */
 
  static char coords[le];
//do stuff with coords
 return coords;
}
Quote
storage size of 'coords' isn't a constant

I am a bit afraid because 'le', should not be a constant because it may change each period of time..  smiley-small
218  Using Arduino / Programming Questions / Re: Do I need a special library for strcpy and strcat on: July 15, 2013, 07:53:20 am
Dear PaulS,

It's interesting what you stated

So if I understood, it is not enought to just return a array, which has been declared and "filled" into an function. It's because it has been declare at the top of the script, we have to use malloc(). That right?

Then I should declare coords in that way (in the function)

Code:
char * coords;
  coords = (char*) malloc (100+1);
instead of
Code:
char coords[100];

May I ask you to correct me or show me an exemple, if I am wrong (I found this, wuth Google, so not sure)?

Many thank
219  Using Arduino / Programming Questions / Re: Do I need a special library for strcpy and strcat on: July 15, 2013, 06:49:39 am
It's works. So the Serial.print() display what I am waiting for but as I am a beginer, I am suspicious  smiley
220  Using Arduino / Programming Questions / Re: Do I need a special library for strcpy and strcat on: July 15, 2013, 06:32:22 am
Hello,

But at the end, this
Code:
char en[]="\0";
is good? I am confuse because it work...

I have a last question.

I declare the function, in that way, now, because I want it to return an array

Code:
char * getGPSCoords(void){
// coords is an array, I will not write all code
 
return coords;

}
Somewhere else in my code, I do this
Code:
Serial.println(getGPSCoords());

And it print the right value.

But when I want to copy the retun of getGPSCoords() into a char, like this
Code:
// To get the size of the return value
    int i = strlen(getGPSCoords());
// Define the size of value
  char value[i];
strcpy(value,getGPSCoords()); 
//value = getGPSCoords();
Serial.println(value);

value display nothing while Serial.println(getGPSCoords()); displays the right value.

However, I add a * at the function, like this
char * getGPSCoords(void){}

What did I wrong to use the return char value in a other function ? smiley-mr-green

Here is the function I need to use
Code:
inet.httpPOST(host, port_post, path_post, value , "Result", 1000);
I also try this, which would be the best
Code:
inet.httpPOST(host, port_post, path_post, getPGSCoords() , "Result", 1000);

Thank
221  Using Arduino / Programming Questions / Re: Do I need a special library for strcpy and strcat on: July 15, 2013, 04:42:58 am
All right, I do not belive!!!!

I think my problem is solved. So I just tried and it works since I make those change

1) I make all Serial.print to use the F() macro
2) I added char en[]="\0"; as I wrote before

I still can get fis from my GPS antena, because I am in a "heavy" buildig, but I am unpatient to try the code while I will be able to get gps fix.

I hope it is definitivly solved.

Thank for all, all, and all
222  Using Arduino / Programming Questions / Re: Do I need a special library for strcpy and strcat on: July 15, 2013, 03:23:45 am
Dear All,
I modified my code in order to have a terminator (\0).
I do niot know if it's a good reasonnement, ans I could not try it yet. But do you think it can be solve the issue?
(I will try later in the day, as soon as I can)

Code:
void getGPSCoords(){
  /*
  memset(&coords, 0 , sizeof(coords));
  memset(&lon, 0 , sizeof(lon));
  memset(&lat, 0 , sizeof(lat));
  memset(&alt, 0 , sizeof(alt));
  memset(&time, 0 , sizeof(time));
  memset(&vel, 0 , sizeof(vel));
  */
 
  #ifdef DEBUG
    stat=gps.getStat();
    if(stat==1){
      Serial.println("NOT FIXED");
    }else if(stat==0){
      Serial.println("GPS OFF");
    }else if(stat==2){
      Serial.println("2D FIXED");
    }else if(stat==3){
      Serial.println("3D FIXED");
    }
    delay(5000);
  #endif   
 
  //Get data from GPS
 
   gps.getPar(lon,lat,alt,time,vel);

 
  char lo[]="lo=";
  char la[]="&la=";
  char al[]="&al=";
  char ti[]="&ti=";
  char ve[]="&ve=";
  char en[]="\0"; // NEW ADD

 #ifdef DEBUG
    // I check if the the variable are filled and display the length
    Serial.print(lon); Serial.print(" "); Serial.println(strlen(lon));
    Serial.print(lat); Serial.print(" "); Serial.println(strlen(lat));
    Serial.print(alt); Serial.print(" "); Serial.println(strlen(alt));
    Serial.print(vel); Serial.print(" "); Serial.println(strlen(vel));
    Serial.print(time); Serial.print(" "); Serial.println(strlen(time));
    Serial.print(lo); Serial.print(" "); Serial.println(strlen(lo));
    Serial.print(la); Serial.print(" "); Serial.println(strlen(la));
    Serial.print(al); Serial.print(" "); Serial.println(strlen(al));
    Serial.print(ti); Serial.print(" "); Serial.println(strlen(ti));
    Serial.print(ve); Serial.print(" "); Serial.println(strlen(ve));
    Serial.print(en); Serial.print(" "); Serial.println(strlen(en));
    Serial.println("-----");
  #endif
 
  int le = strlen(lo)+strlen(la)+strlen(al)+strlen(ti)+strlen(ve)+strlen(en)+strlen(lon)+strlen(lat)+strlen(alt)+strlen(vel)+strlen(time);
  Serial.println(le);
 
  char coords[le]; // NEW CHANGE
 
  strcpy(coords,lo);
  strcat(coords,lon);
 
  strcat(coords,la);
  strcat(coords,lat);
 
  strcat(coords,al);
  strcat(coords,alt);

  strcat(coords,ti);
  strcat(coords,time);
 
  strcat(coords,ve);
  strcat(coords,vel);
 
  strcat(coords,en); // NEW ADD
 
 
  #ifdef DEBUG
    Serial.print(F("Coords : "));                               
    Serial.println(coords);
 //   Serial.println(strlen(coords));
  #endif
 
 
}
223  Using Arduino / Programming Questions / Re: Do I need a special library for strcpy and strcat on: July 15, 2013, 02:15:35 am
Thank for all, for all of your suggesrion.

I am very happy, because I got a success solution but not at 100%. There is a little bug at the end, but I am on a good solution.

I modify my code, as the following:
I move the initialisation of char coords[]; to the getGPSCoords() function
Code:
void getGPSCoords(){
  /*
  memset(&coords, 0 , sizeof(coords));
  memset(&lon, 0 , sizeof(lon));
  memset(&lat, 0 , sizeof(lat));
  memset(&alt, 0 , sizeof(alt));
  memset(&time, 0 , sizeof(time));
  memset(&vel, 0 , sizeof(vel));
  */
 
// Get static on GPS status/availability
  #ifdef DEBUG
    stat=gps.getStat();
    if(stat==1){
      Serial.println("NOT FIXED");
    }else if(stat==0){
      Serial.println("GPS OFF");
    }else if(stat==2){
      Serial.println("2D FIXED");
    }else if(stat==3){
      Serial.println("3D FIXED");
    }
    delay(5000);
  #endif   
 
  //Get data from GPS
   gps.getPar(lon,lat,alt,time,vel);

  #ifdef DEBUG
    // I check if the the variable are filled and display the length
    Serial.print(lon); Serial.print(" "); Serial.println(strlen(lon));
    Serial.print(lat); Serial.print(" "); Serial.println(strlen(lat));
    Serial.print(alt); Serial.print(" "); Serial.println(strlen(alt));
    Serial.print(vel); Serial.print(" "); Serial.println(strlen(vel));
    Serial.print(time); Serial.print(" "); Serial.println(strlen(time));
    Serial.println("-----");
  #endif
 
   char lo[]="lo=";
   char la[]="&la=";
   char al[]="&al=";
   char ti[]="&ti=";
   char ve[]="&ve=";
 
   // Count the number of caracter of the coords + the string, which are now, type of char (and not string any more)
   int le = strlen(lo)+strlen(la)+strlen(al)+strlen(ti)+strlen(ve)+strlen(lon)+strlen(lat)+strlen(alt)+strlen(vel)+strlen(time);
   // Disèplay the number of caracter
   Serial.println(le);
 // Iniatiate the coords with the exact number of caracter, whatever if lat, lon, alt change of length
 // Add +1 for the terminator
  char coords[le+1];
 
  // Concatenate all char varaiable
  strcpy(coords,lo);
  strcat(coords,lon);
 
  strcat(coords,la);
  strcat(coords,lat);
 
  strcat(coords,al);
  strcat(coords,alt);

  strcat(coords,ti);     
  strcat(coords,time);   
 
  strcat(coords,ve);     
  strcat(coords,vel);
 
  #ifdef DEBUG
    Serial.print(F("Coords : "));                               
    Serial.println(coords);
    Serial.println(strlen(coords));
  #endif
 
 
}

I am very happy, because coords display the correct value. here is my display:
I am in a train and I can not get fix, It's the reason why we have 0.000000, but it does not matter, for my issue
Quote
GETTING GPS COORDS
--------------------------------
In progress, wait...
NOT FIXED
0.000000 8
0.000000 8
0.000000 8
0.000000 8
20130714223032.000 18
-----
(the lenght of char lo, la, al, ti and ve are not display here)
69
Coords : lo=0.000000&la=0.000000&al=0.000000&ti=20130714223032.000&ve=0.000000

Code:
The last problem:
After, the terminal display the result of
Quote
Coords : lo=0.000000&la=0.000000&al=0.000000&ti=20130714223032.000&ve=0.000000
the program stop working, like if it freeze.
Would you have an idea, why it freeze juste at the "end"?
224  International / Français / Re: Comment puis-je envoyer un array en post on: July 15, 2013, 12:33:34 am
Aussi, ca ca ne marche pas non plus

Code:
String message = "test1"+"test2";
Le message d'erreur : "Invalid  operands of types 'const char [5]' and 'const char [5]' to binary 'operateu' +"

J'essaye de concatener des String, maintenant.
225  International / Français / Re: Comment puis-je envoyer un array en post on: July 14, 2013, 03:41:18 pm
Merci pour ta réponse.
Je deviens un peu fou  smiley

je fais ceci:
Code:
String fix = "long=" + String(lon) + "&lat=" + String(lat) + "&alti=" + String(alt) + "&vel=" + String(vel) + "&time=" + String(time);


 Serial.println(fix);
 Serial.println(fix.length());
fix.toCharArray(coords, 109);
//(j'aimerais remplacé 109 par fix.length()+1
//char coords[fix.length()+1];
//fix.toCharArray(coords, fix.length()+1);
// Le +1 pour laisser une place au terminateur, comme tu me l a expliqué

pourquoi fix n'affiche rien? Il affiche vide.
(lon, lat, alt, vel, time, sont des char.
Pages: 1 ... 13 14 [15] 16 17 ... 31